更新我们的一件制品后出现错误的符号引用错误

问题描述 投票:0回答:1

我将依赖项之一更新为 3.10.2,这是我们公司工件中的最新版本,将 IntelliJ 中的项目 sdk 更新为 JDK 17,我正在使用 Scala sdk 2.13.8 在进行 Maven 编译时,我遇到了以下异常。

***** missing reference, looking for Extension/T in package io.pebbletemplates.pebble.extension decls = Scope{} [ERROR] [Error] : Bad symbolic reference. A signature in /Users/manr4/.m2/repository/io/gatling/gatling-core/3.10.5/gatling-core-3.10.5.jar(io/gatling/core/body/BodySupport.class) refers to Extension/T in package io.pebbletemplates.pebble.extension which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling /Users/manr4/.m2/repository/io/gatling/gatling-core/3.10.5/gatling-core-3.10.5.jar(io/gatling/core/body/BodySupport.class).

我没有在代码中的任何地方使用 
io.pebbletemplates.pebble.extension

我的pom.xml

<properties> <gcle.version>3.10.2</gcle.version> <commons-io.version>2.14.0</commons-io.version> <json4s-jackson.version>4.1.0-M2</json4s-jackson.version> <scalaj-http.version>2.4.2</scalaj-http.version> <aws-java-sdk-s3.version>1.12.693</aws-java-sdk-s3.version> </properties> <dependencies> <dependency> <groupId>com.company.app</groupId> <artifactId>gatling-config-library-ext</artifactId> <version>${gcle.version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>${commons-io.version}</version> </dependency> <dependency> <groupId>org.json4s</groupId> <artifactId>json4s-jackson_3</artifactId> <version>${json4s-jackson.version}</version> </dependency> <dependency> <groupId>org.scalaj</groupId> <artifactId>scalaj-http_2.13</artifactId> <version>${scalaj-http.version}</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-s3</artifactId> <version>${aws-java-sdk-s3.version}</version> </dependency> </dependencies>

galing-config-library-ext pom.xml
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <gcl.version>2.0.0</gcl.version>
        <gatling.version>3.10.5</gatling.version>
        <spock.version>2.3-groovy-4.0</spock.version>
        <typesafe.version>1.4.3</typesafe.version>
        <scalatest.version>3.2.18</scalatest.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-junit4</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
            <version>${typesafe.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gatling.highcharts</groupId>
            <artifactId>gatling-charts-highcharts</artifactId>
            <version>${gatling.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.pebbletemplates</groupId>
                    <artifactId>pebble</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.pebbletemplates</groupId>
            <artifactId>pebble</artifactId>
            <version>3.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.company.app</groupId>
            <artifactId>gatling-config-library</artifactId>
            <version>${gcl.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scalactic</groupId>
            <artifactId>scalactic_2.13</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.13</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalamock</groupId>
            <artifactId>scalamock_2.13</artifactId>
            <version>5.2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

您的 gadling-config-library-ext 库的 pom 明确从 Gadling 依赖项分支中排除 pebble 依赖项。
您的主要项目是通过这个库传递 Ga特林 加特林,因此类路径中缺少 pebble。
由于 pebble 是必需的依赖项,而不是可选的依赖项,因此我们的一个类无法加载。
java scala gatling pebble
1个回答
0
投票
您必须停止从类路径中强行删除 pebble。您不使用它并不意味着加特林可以在没有它的情况下工作。

© www.soinside.com 2019 - 2024. All rights reserved.