0

Java 8 から Java 11 にアップグレードするときに、Evosuite Maven プラグイン (バージョン 1.0.6) の問題に直面しています。Maven ビルドの実行中java.lang.ClassNotFoundException Caused by: java.lang.IllegalArgumentExceptionに、Sample_ESTest.javaファイルのエラーで evsuite テスト クラスが失敗しました。

pom.xml

    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <dependency>
        <groupId>org.evosuite</groupId>
        <artifactId>evosuite-standalone-runtime</artifactId>
        <version>1.0.6</version>
        <scope>test</scope>
    </dependency>

        <plugin>
            <groupId>org.evosuite.plugins</groupId>
            <artifactId>evosuite-maven-plugin</artifactId>
            <version>1.0.6</version>
        </plugin>

Sample_ESTest.java

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) 
public class Sample_ESTest {
...
}

問題の詳細を取得するために、evsuite ヘルプ コマンド ( mvn evosuite:help) を実行しようとしたところ、次のエラーが表示されました。

Failed to execute goal org.evosuite.plugins:evosuite-maven-plugin:1.0.6:help (default-cli) on project java11-upgrade: Execution default-cli of goal org.evosuite.plugins:evosuite-maven-plugin:1.0.6:help failed: Plugin org.evosuite.plugins:evosuite-maven-plugin:1.0.6 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.0.0 at specified path C:\My_Space\Tools\JDK\jdk-11.0.8/../lib/tools.jar

エラーはアーティファクトcom.sun:tools:jar:1.0.0を見つけられなかったと言いますが、私の理解によれば、tools.jarはJava11で削除されています。この問題を解決するために私を助けてください。

前もって感謝します!

4

1 に答える 1

1

1.0.6 は Java 11 と互換性がないと思います。それは 1.1.0 です。残念ながら、この回答の時点では、1.1.0 の maven プラグインは現在利用できないため、次の最善の方法は、https ://github.com/EvoSuite/ にある 1.1.0 の .jar ファイルを使用することです。エボスイート/リリース/タグ/v1.1.0

于 2021-02-09T13:34:48.520 に答える