Uploaded image for project: 'Maven Release Plugin'
  1. Maven Release Plugin
  2. MRELEASE-735

Profile activation working unpredictably

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 2.2.2
    • None
    • perform
    • None

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tokoloko Thorsten Koch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment