mavenmaven-profiles

Maven - Profile&Modules - Activation by property?


Could someone help me understand this issue below? Approach #1 below works as expected, when the IDE asks maven to build the project it rebuilds moduleA and include it as a dependency; everybody happy. Approach #2 which is what I want to use does not behave the same way, myProperty is a system property I've defined and toggling it between true/false does activate the profile BUT it does not build moduleA, why?

#1

...
<profiles>
   <profile>
      <id>testProfile</id>
      <activation>
         <activationByDefault>true</activationByDefault>
      </activation>
   </profile>
   <modules>
      <module>../moduleA</module>
   </modules>
</profiles>
...

#2

...
<profiles>
   <profile>
      <id>testProfile</id>
      <activation>
         <property>
            <name>myProperty</name>
            <value>true</value>
         </property>
      </activation>
   </profile>
   <modules>
      <module>../moduleA</module>
   </modules>
</profiles>
...

Solution

  • Oh, after hours up and down the documentation I found my problem. Was not aware that the name of the config file mattered, so I had named it jvm.config as I saw the bash script looked after such a file for maven options. Apparently it was supposed to be in maven.config