Maven 如何在同一pom的2个不同配置文件中使用2个surefire插件配置
我试图在maven pom文件中运行2个配置文件。 配置文件的每一页都使用maven sure fire插件和配置:Maven 如何在同一pom的2个不同配置文件中使用2个surefire插件配置,maven,pom.xml,maven-surefire-plugin,Maven,Pom.xml,Maven Surefire Plugin,我试图在maven pom文件中运行2个配置文件。 配置文件的每一页都使用maven sure fire插件和配置: <profiles> <profile> <id>profile1</id> <modules> <module>module1</module> <module>module-common<
<profiles>
<profile>
<id>profile1</id>
<modules>
<module>module1</module>
<module>module-common</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/TestSuite1.java</include>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>profile2</id>
<modules>
<module>module2</module>
<module>module-common</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/TestSuite2.java</include>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
简介1
模块1
通用模块
org.apache.maven.plugins
maven surefire插件
**/TestSuite1.java
**/*Test.java
org.apache.maven.plugins
maven编译器插件
1.7
1.7
简介2
模2
通用模块
org.apache.maven.plugins
maven surefire插件
**/TestSuite2.java
**/*Test.java
org.apache.maven.plugins
maven编译器插件
1.7
1.7
当我运行1个概要文件时,测试以与TestSuite中相同的顺序运行,但当我运行2个概要文件时,第一个概要文件以任意顺序运行测试。
测试正在JUnit中运行
有什么想法吗?问题是maven优化了配置文件和测试,您可以创建两个不同的步骤来运行配置文件 或者(就像你可能做的那样) 创建第三个配置文件以包括这两个配置文件 此外,我认为CsatDistributionTest类名中有一个输入错误 伊蒂尔