I have the following XML in my maven POM.xml:
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>default</name>
<value>!disabled</value>
</property>
</activation>
<modules>
<module>m1</module>
<module>m2</module>
<module>m3</module>
</modules>
</profile>
<profile>
<id>x</id>
<modules>
<module>m1</module>
</modules>
</profile>
</profiles>
What I'm trying to achieve is this:
When I run
mvn install
, I want it to build m1, m2 and m3 projects.When I run
mvn install -Px
, I want it to only build m1.
My current problem is that with the code above, option 2 builds all m1, m2 and m3.