我想在 tomcat 远程 7 上使用 Arquillian 运行我的测试。这是一个非常简单的示例来重现我的问题。
pom依赖:
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-remote-7</artifactId>
<version>1.0.0.CR5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
arqullian.xml:
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="tomcat-remote-7">
<configuration>
<property name="host">localhost</property>
<property name="jmxPort">8089</property>
<property name="bindHttpPort">8080</property>
<property name="user">arquillian</property>
<property name="pass">arquillian</property>
</configuration>
</container>
简单测试.java
@RunWith(Arquillian.class)
public class SimpleTest {
@Deployment
@OverProtocol("Servlet 3.0")
public static Archive<WebArchive> createDeployment() {
File warFile = new File("../myproject/target/mywar.war");
WebArchive webArchive = ShrinkWrap.createFromZipFile(WebArchive.class, warFile);
return webArchive;
}
@Test
public void testSimple() {
assertTrue(true);
}
}
运行 SimpleTest 后,我得到很长的堆栈跟踪,最后我看到:
Caused by: java.lang.ClassNotFoundException:
org.jboss.arquillian.container.tomcat.remote_6.TomcatRemoteExtension
我想知道为什么当我在依赖版本 7 中时它会尝试为版本 6 加载 TomcatRemoteExtension