I have a profile in my pom.xml which should be always active unless it is explicitely deactivated (-P !firstProfile). I solved this by using the activeByDefault flag:
<
Profiles are a good way to bring some order into POM. Especially if you use multiple executions of the same plugin for different purposes.
alwaysActive
.
...
This will always be true (unless someone deletes the directory during Maven boot :). Tested with Maven 3.6.0.
It might also be a good way to differentiate between types of projects. For instance, my project has always module.json present.
There are a few Maven extensions for profile activation. One of them in a fork here:
https://github.com/OndraZizka/el-profile-activator-extension