Activate Maven profile if another profile is not activated

I have a project with several profiles. How do you activate one of the profiles only if the other profiles are not active?

+5
source share
1 answer

As explained in Introduction to Profile Assembly :

Profiles can also be active by default using a configuration such as the following:

<profiles>
  <profile>
    <id>profile-1</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    ...
  </profile>
</profiles>

This profile will be automatically active for all assemblies if another profile in the same pump is activated using one of the previously described methods. All active profiles are automatically deactivated by default when the profile in the pump is activated on the command line or through the activation configuration.

+18
source

All Articles