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

releaseProfiles works only if at least one (default) profile is activated in the same pom.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.4
    • perform
    • None
    • WindowsXP, Maven-2.2.1

    Description

      related to MRELEASE-459 I decided to define an empty "dummy" profile, which is activated by default instead of passing -P... at the command line at mvn release:perform.

      I´ve put this into our company parent pom.xml, next to the release profile that might be enabled during mvn release:perform:

      <profiles>
      	<!-- default profile is needed, because otherwise mvn release:perform will not activate the release profile -->
      	<!-- see http://jira.codehaus.org/browse/MRELEASE-459 for details-->
      	<profile>			
      		<id>dummy</id>
      		<activation>
      			<activeByDefault>true</activeByDefault>
      		</activation>
      	</profile>
      		
      	<profile>			
      		<id>release</id>
      		<properties>
      			<!-- could be used at mvn release:perform -->
      			<!-- will set productVersion to the current (released)project.scm.tag -->
      			<productVersion>${project.scm.tag}</productVersion>		
      		</properties>
      	</profile>
      

      Than, in one child module I configured the maven-release-plugin as:

      	<configuration>
      		<workingDirectory>c:\LocalViewsRelease\${project.artifactId}-${project.version}</workingDirectory>
      		<preparationGoals>clean install</preparationGoals>
      		<releaseProfiles>release</releaseProfiles>
      	</configuration>	
      

      => this should activate the dummy profile (which is activated by default) and the release profile - but it does NOT !

      [DEBUG] Executing: cmd.exe /X /C "C:\eap\apache-maven-2.2.1\bin\mvn.bat -X -D maven.repo.local=D:\mavenrepo -D performRelease=true deploy site-deploy"
      

      I could only get this to work copying the dummy profile again into the child pom.xml.

      [DEBUG] Executing: cmd.exe /X /C "C:\eap\apache-maven-2.2.1\bin\mvn.bat -X -D maven.repo.local=D:\mavenrepo -D performRelease=true -P dummy,release deploy site-deploy"
      

      The fix should:

      • fix MRELEASE-459 first, so no more default profile is needed to get releaseProfiles to work
      • fix the inheritance of (default) profiles during mvn release:perform

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            reinhart Torsten Reinhard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: