I know it's impossible to "chain" profile declaration. It's possible to do what I want (but not completely) with System properties in command line like mvn -Dvar=value . And then use this:
<activation>
<property>
<name>var</name>
<value>value</value>
</property>
</activation>
or to activate simultaneously several profiles with -P profile1, profile2
In fact I have 4 profiles and I want to create a fifth profile with all the aspectj part (plugins, dependencies, ...) which should be activated only if profile 1, 2 or 3 is activated. Like that I don't have redundant plugins and dependencies declarations.
<profile>
<id>profile1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
...
</build>
</profile>
<profile>
<id>profile2</id>
<build>
...
</build>
</profile>
<profile>
<id>profile3</id>
<build>
...
</build>
</profile>
<profile>
<id>profile4</id>
<build>
<plugins>
<plugin>
...
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>aop</id>
<build>
<plugins>
<plugin>
...
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
...
</dependency>
<dependency>
...
</dependency>
</dependencies>
</profile>
The problem is that profile 1 is the default profile and even it should be possible to do it without command line args. I tried with defining a value but it doesn't work because activation property only works with system properties.
Am I wrong? Is there another way to do it?
Thanks