How to Skip Maven Plugin
- Create a Profile
- Override the plugin in child pom.xml
- while running mvn in command prompt pass the profile as parameter
>>mvn clean install -Pprofile_name
If the plugin supports skip tag
<profiles> <profile> <id>skipTestAndDb</id> <properties> <skipTests>true</skipTests> <liquibase.should.run>false</liquibase.should.run> </properties> <plugin> <groupId>group</groupId> <artifactId>artifact</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </profile> </profiles>
Sometimes the plugin doesn’t support skip tag, in such case define use executions tag. If there is ID in parent pom.xml then same ID should be used in child pom.xml as well. If no ID is given setting phase to none alone would work. To get the plugin details for id run mvn help:effective-pom or Intellij->Right click on project -> Maven -> Show Effective POM
<plugin> <groupId>group</groupId> <artifactId>artifact</artifactId> <executions> <execution> <id>TheNameOfTheRelevantExecution</id> <phase>none</phase> </execution> </executions> </plugin>