Java 如何使用Arquillian从单独的Maven模块测试战争内容
我在网络上找到了一些零碎的知识,但还没能把它们组合起来解决这个具体案例。这似乎是一个很好的开始,但它专门处理耳朵依赖 我的(简化的)maven项目结构如下:Java 如何使用Arquillian从单独的Maven模块测试战争内容,java,maven,integration-testing,jboss-arquillian,Java,Maven,Integration Testing,Jboss Arquillian,我在网络上找到了一些零碎的知识,但还没能把它们组合起来解决这个具体案例。这似乎是一个很好的开始,但它专门处理耳朵依赖 我的(简化的)maven项目结构如下: parent |__domain (a jar) |__domain-it (integration tests for the domain module) |__web (a war; depends on domain) |__web-it (integration tests for the
parent
|__domain (a jar)
|__domain-it (integration tests for the domain module)
|__web (a war; depends on domain)
|__web-it (integration tests for the web module)
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>web</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>war</type>
</dependency>
我正在寻找以下问题的解决方案:
web
模块包含的代码web it
模块中李>
web
模块依赖于domain
模块,因此web it
集成测试也需要将domain
模块中的代码放在类路径上李>
domain
和web
都依赖于某些第三方库,例如
org.apache.commons:commons-lang3
在测试类路径上也需要它web it/pom.xml
中,使web it
依赖于web
,如下所示:
parent
|__domain (a jar)
|__domain-it (integration tests for the domain module)
|__web (a war; depends on domain)
|__web-it (integration tests for the web module)
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>web</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>war</type>
</dependency>
在web it/pom.xml
中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>web</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>classes</classifier>
</dependency>
${project.groupId}
,如中所述。但是,在m2e/eclipse中使用它时,似乎存在一些问题,我希望能够从eclipse运行集成测试
你使用什么版本的maven war插件<代码>附件类从2.1-alpha-2开始提供