Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.0-alpha-3
-
Component/s: Profiles
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
I would expect each subproject to have the profile turned on or off depending on whether ${basedir}/file-to-check-for exists.
Instead, during a multi-project build the profile is either on or off depending on whether the file exists relative to the aggregator pom. The decision is made once.
Variable substitution doesn't work, so I can't explicitly use <exists>${basedir}/file-to-check-for</exists> or any variation on this theme to workaround the bug.
Some background to my particular problem. I have 10 modules to build. Some of them are GUI modules and contain a file called plugin.xml in the subproject directory. I want to package these up specially and sign them, ready for deployment to webstart. The other modules are shared and server code and I don't want these packaged in the same way. So, I've got a dependency in my parent pom file which activates a profile called "guibundle" if a plugin.xml file exists in the subproject directory.
Issue Links
- is duplicated by
-
MNG-1775
No property expansion in profile activation
-
-
MNG-3017
Profile activation by file fails when maven is run outside the pom's directory
-
-
MNG-3524
Profile to be activated when file is missing is always activated
-
-
MNG-4120
Profile activation should be per module
-
-
MNG-4174
Inheritance from profiles from parent-pom to child-pom
-
-
MNG-4620
Reporting profiles not executed in child modules.
-
-
MNG-3140
add support for ${basedir} property in profile activation
-
- relates to
-
MNG-5360
profile/activation/file does not work with ${project.basedir}, only with ${basedir}
-
-
MNG-4735
File-based profile activation behaves differently in Maven 3
-
Actually, not even an <activeByDefault/> causes a profile to become active during a multi-project build.
Please unzip problemactivation.zip into a directory. Then navigate into the child folder and execute:
mvn install
You will see a printout of the effective pom.
Now navigate back a directory and execute:
mvn -f pom-aggregator.xml install
You will not see a printout of the effective pom, even though the profile should have been activated.
I have also commented in the parent pom.xml that <file/> activation doesn't work either. This bug relates more to <file/> activation, but it's important to get the <activeByDefault/> working first.