I have a spring boot application.
The sprinboot pom is added as a parent
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
</parent>
This is the failsafe dependency mentioned under <pluginmanagement>
section in the spring-boot-starter-parent-2.1.2
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.outputDirectory</classesDirectory>
</configuration>
</plugin>
I also have a failsafe defined in my project build phase under a different profile. All my IT files end with 'IT'.
<profile>
<id>myProfile</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<groups>${it.groups}</groups>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
When I run mvn integration-test -PmyProfile
,
maven starts running the default failsafe execution mentioned in the spring dependency first. And then it runs the plugin from my pom.
That is causing my Integration tests to run twice.
I dont want the IT to be run using the failsafe plugin mentioned in the spring pom.
How do I do that ? I dont want to redefine the plugin in my pom.
I just want to remove the goals mentioned in the spring-starter pom.xml