我在mvn中有以下结构。如何从父mvn模块运行测试?
| pom.xml (parent)
|
|
+----- module A (common classes)
| | pom.xml
| |
| \---src
| +---main
| |
| \---test
| +---junit
| |
| \---integration
|
+----- module B (web app)
| | pom.xml
| |
| \---src
| +---main
|
+----- module C (web app)
| | pom.xml
| |
| \---src
| +---main
模块A是所有后续模块(B,C,...)继承的模块。该模块具有通用功能和junit /集成测试用例。这不是一个网络应用程序。
模块B是一个Web应用程序。它有模块B.
模块C的依赖性是一个Web应用程序。它在模块A.这样的模块B.
我们的球衣休息/ API代码依赖生命无论我们怎样部署模块,我们将始终有机会获得休息/ API。
到目前为止,我已经成功地配置模块C的Maven插件的FailSafe当我运行顶(父)的pom.xml站起来一个Tomcat实例(即:MVN验证)。
然而,模块C是不是能看到模块答:我曾尝试配置Maven-JAR-插件(http://maven.apache.org/guides/mini/guide-attached-tests.html)的集成测试。
在模块AI的pom.xml的有:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
和模块C1有:
<dependency>
<groupId>groupId</groupId>
<artifactId>SCCommon</artifactId>
<type>test-jar</type>
<classifier>tests</classifier>
<version>9.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
谁能帮我找出我如何可以运行在MODULA的集成测试当mvn正在运行Module C故障安全插件时。
注:集成测试被命名为* IT.java因此得到由故障安全插件回升。
是否有这样做或Am即使使用正确的插件的任何其他方式?
非常感谢。
如果您需要制作' **/* IT.java '这是指示器具有单独的集成测试模块,您应该在其中进行集成测试。 –
khmarbaise