Question

I have a project that has several profiles. How do you make one of the profiles activate only if no other profiles are active?

Was it helpful?

Solution

As explained in Introduction to Build Profiles:

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

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

This profile will automatically be active for all builds unless another profile in the same pom is activated using one of the previously described methods. All profiles that are active by default are automatically deactivated when a profile in the pom is activated on the command line or through its activation config.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top