Is there a way to achieve deactivation of the maven profile by property?

I want to have a profile that runs a specific plugin (like PMD), but I want to explicitly disable this plugin execution.
So I want to have a profile that is always active, unless the property is defined.
Something like mvn -Dnopmd clean install, and the profile is deactivated. In addition, the profile must always be active.

+8
maven
source share
1 answer

You can activate the profile if the property is not specified like this:

<profile> <id>someprofile</id> <activation> <property> <name>!property.name</name> </property> </activation> </profile> 
+14
source share

All Articles