I wonder why it is not working corecttly. I want to have itTest profle which will start integration(failsafe plugin) and unit(surefire plugin) via Maven. My configuration:
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>${unit-tests.skip}</skip>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>${integration-tests.skip}</skip>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
profile
<profile>
<id>itTest</id>
<properties>
<propFile>profiles/itTest.properties</propFile>
<spring.profile>itTest</spring.profile>
<integration-tests.skip>false</integration-tests.skip>
<unit-tests.skip>false</unit-tests.skip>
</properties>
</profile>
Result: both tests are skipped... even i change profile or hardcoded skip to false it still doesnt work.
我不知道为什么您的配置确实不执行您想要的操作(可能与评估属性的顺序有关,所以重置属性时已经对属性进行了评估),但是通常的处理方法是将整个插件配置放入配置文件中。
Rather than putting both plugins in as default and trying to skip them I think you can simply declare the plugins within the profiles themselves. Ie
<profile>
<id>itTest</id>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugins>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.