Java 11的Evosuite插件问题



从Java 8升级到Java 11时,我遇到了Evosuite maven插件(版本1.0.6(的问题。在运行maven构建时,evosuite测试类失败,在我的Sample_ESTest.java文件中出现错误java.lang.ClassNotFoundException Caused by: java.lang.IllegalArgumentException

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帮助命令(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_SpaceToolsJDKjdk-11.0.8/../lib/tools.jar

错误说找不到工件com.sun:tools:jar:1.0.0,但据我所知,tools.jar在Java11中被删除了。你能帮我解决这个问题吗。

提前感谢!

我认为1.0.6与Java 11不兼容,应该是1.1.0。不幸的是,在回答这个问题时,1.1.0的maven插件目前还不可用,所以下一个最好的办法是使用这里的1.1.0的.jar文件:https://github.com/EvoSuite/evosuite/releases/tag/v1.1.0

相关内容

  • 没有找到相关文章

最新更新