从 Java 8 升级到 Java 11 时,我遇到了 Evosuite maven 插件(版本 1.0.6)的问题。在运行 maven build 时,evosuite 测试类失败并出现java.lang.ClassNotFoundException Caused by: java.lang.IllegalArgumentException
我的Sample_ESTest.java
文件错误。
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 {
...
}
为了获得更多问题的详细信息,我尝试执行 evosuite help 命令 ( 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 中被删除。你能帮我解决这个问题吗?
提前致谢!