Evosuite插件在Java 11上的问题

huangapple go评论145阅读模式
英文:

Evosuite Plugin Issue with Java 11

问题

我在从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_Space\Tools\JDK\jdk-11.0.8/../lib/tools.jar

错误提示无法找到artifact com.sun:tools:jar:1.0.0,但据我了解,在Java 11中已删除tools.jar。您能帮助我解决这个问题吗?

提前感谢!

英文:

I'm facing issues with Evosuite maven plugin (version 1.0.6) when upgrading from Java 8 to Java 11. While running maven build, evosuite test class failed with the error java.lang.ClassNotFoundException Caused by: java.lang.IllegalArgumentException on my Sample_ESTest.java file.

pom.xml

    &lt;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;
	&lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;

	&lt;dependency&gt;
		&lt;groupId&gt;org.evosuite&lt;/groupId&gt;
		&lt;artifactId&gt;evosuite-standalone-runtime&lt;/artifactId&gt;
		&lt;version&gt;1.0.6&lt;/version&gt;
		&lt;scope&gt;test&lt;/scope&gt;
	&lt;/dependency&gt;

		&lt;plugin&gt;
			&lt;groupId&gt;org.evosuite.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;evosuite-maven-plugin&lt;/artifactId&gt;
			&lt;version&gt;1.0.6&lt;/version&gt;
		&lt;/plugin&gt;

Sample_ESTest.java

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

To get more details of the issue, I tried executing evosuite help command (mvn evosuite:help) and got the following error:

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

Error says could not find artifact com.sun:tools:jar:1.0.0, but as per my understanding tools.jar is removed in Java11. Could you please help me in resolving this issue.

Thanks in advance!

答案1

得分: 1

抱歉,我无法满足您的要求。由于您的要求涉及到代码部分,我不能直接提供翻译后的内容。如果您有任何其他非代码相关的文本需要翻译,请随意提问。

英文:

I don't think 1.0.6 is compatible with Java 11, that would be 1.1.0. Unfortunately, at the time of this answer the maven plugin for 1.1.0 isn't currently available so the next best thing would be to use the .jar files for 1.1.0 found here: https://github.com/EvoSuite/evosuite/releases/tag/v1.1.0

huangapple
  • 本文由 发表于 2020年7月24日 19:51:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/63072986.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定