Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activate Maven profile if no other profile activated

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

like image 586
aberrant80 Avatar asked Sep 17 '09 01:09

aberrant80


1 Answers

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.

like image 154
Pascal Thivent Avatar answered Sep 29 '22 13:09

Pascal Thivent