Thorsten Koch created MRELEASE-735:
--------------------------------------
Summary: Profile activation working unpredictably
Key: MRELEASE-735
URL: https://jira.codehaus.org/browse/MRELEASE-735
Project: Maven 2.x Release Plugin
Issue Type: Bug
Components: perform
Affects Versions: 2.2.2
Reporter: Thorsten Koch
Attachments: parent.zip
In an attempt to work around issue
http://jira.codehaus.org/browse/MASSEMBLY-457 I tried to use the following
profiles to set a property depending of the existens of a certain directory in
my multimodule build:
<profiles>
<profile>
<id>runAssembly</id>
<activation>
<file>
<exists>src/main/sql</exists>
</file>
</activation>
<properties>
<skipAssembly>false</skipAssembly>
</properties>
</profile>
<profile>
<id>dontRunAssembly</id>
<activation>
<file>
<missing>src/main/sql</missing>
</file>
</activation>
<properties>
<skipAssembly>true</skipAssembly>
</properties>
</profile>
</profiles>
This is working well in normal builds. I can use the ${skipAssembly} property
to switch on and of the assembly plugin depending of the directory existence in
my modules.
However, in the build run by the release:perform goal, this does not work. In
this case always the second profile from the above is activated, regardless if
the directory exists or not.
But I found out (after a lot of tries), that it DOES work if the order of the
profiles above is just changed. So when I write it like this
<profiles>
<profile>
<id>dontRunAssembly</id>
<activation>
<file>
<missing>src/main/sql</missing>
</file>
</activation>
<properties>
<skipAssembly>true</skipAssembly>
</properties>
</profile>
<profile>
<id>runAssembly</id>
<activation>
<file>
<exists>src/main/sql</exists>
</file>
</activation>
<properties>
<skipAssembly>false</skipAssembly>
</properties>
</profile>
</profiles>
THEN it's working even in release:perform builds. I have no idea what the
triggering change is, but it seems worth creating an issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira