Alexander Rühl
Alexander Rühl

Reputation: 6939

How to skip a maven build step without modifying the pom itself?

We have a maven based Java EE project controlled by the customer. For internal reasons, we cannot execute one of the build steps, but the rest works fine and produces the jar we want.

Since editing the pom file would require taking care when committing to customer's SVN and copying the pom file would require taking care to sync changes comming from there, we are looking for a way to skip this specific step in the build section during the maven call itself, so to say mvn clean install but-leave-out-this-build-plugin-step, is there any?


Edit:

The plugin in question is the rpm-maven-plugin, which prevents the build from running on Windows. We found information how to make it work which won't really fit in our current setup. And since we cannot modify the customer's pom, I was looking for a way to trigger the skipping externally. But maybe there are other ways to just ignore/skip/fake this step?

Upvotes: 6

Views: 4626

Answers (1)

commit-man
commit-man

Reputation: 376

It depends on what plugin you want to skip. Many plugins have ability to be skipped via system property (-Dblabla). For deploy plugin it is -Dmaven.deploy.skip=true, for surefire -DskipTests=true. Read plugin documentation, maybe you can find skip property


The rpm plugin hase a property disabled, unfortunately it is not accessible by a property. So, if setting this property in the customer's pom (or asking for editing it) with a default value of false is an option, this may be the solution.

Upvotes: 5

Related Questions