Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-3

release:prepare should not require multimodule artifacts to be in the local repository

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: prepare
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently, if you try to run release:prepare on a multimodule project after removing any of that build's artifacts from the local repository, it will fail. Investigate why release:prepare needs the multimodule artifacts installed in the local repository before it can succeed.

      To reproduce, comment the following line in it2002/test.sh:

      mvn clean install

      NOTE: This may have to do with the version resolution code, which is used to resolve SNAPSHOT versions.

        Issue Links

          Activity

          Hide
          Dan Tran added a comment -

          does it mean, after reach daily release where we have a new snaphot version, I must install a snapshot of my build artifact to my local repo? ( mvn install ) so that the next release:prepare would work.

          Show
          Dan Tran added a comment - does it mean, after reach daily release where we have a new snaphot version, I must install a snapshot of my build artifact to my local repo? ( mvn install ) so that the next release:prepare would work.
          Hide
          John Casey added a comment -

          appears that the project references aren't being resolved correctly. I'll have to attach a debugger and figure out why.

          UPDATE: To duplicate this problem, you actually need to:

          1. Remove all traces of org/apache/maven/it2002/* from your local repo
          2. Comment out the line: 'mvn clean install' in it2002/test.sh
          3. Run test.sh in it2002 dir.

          Show
          John Casey added a comment - appears that the project references aren't being resolved correctly. I'll have to attach a debugger and figure out why. UPDATE: To duplicate this problem, you actually need to: 1. Remove all traces of org/apache/maven/it2002/* from your local repo 2. Comment out the line: 'mvn clean install' in it2002/test.sh 3. Run test.sh in it2002 dir.
          Hide
          Brett Porter added a comment -

          "Project references" - I assume you mean project.getArtifact() ? This can only happen when the artifact is created (or a semblance of it) - ie at compile, package, install phases where it is target/classes, target/XXX.jar or the local repository versions respectively.

          Show
          Brett Porter added a comment - "Project references" - I assume you mean project.getArtifact() ? This can only happen when the artifact is created (or a semblance of it) - ie at compile, package, install phases where it is target/classes, target/XXX.jar or the local repository versions respectively.
          Hide
          Dan Tran added a comment -

          John, Do you have any progress on this JIRA? I have a scenario where I need to do a release:prepare without the availablity of the snapshots.
          Let me know what I can do to help.

          Show
          Dan Tran added a comment - John, Do you have any progress on this JIRA? I have a scenario where I need to do a release:prepare without the availablity of the snapshots. Let me know what I can do to help.
          Hide
          Barrie Treloar added a comment -

          MRELEASE-182 (release:prepare preparationGoals should be "clean verify") may be related to this issue.

          I disagree with the recommendation in MRELEASE-182 as I believe that "install" needs to happen as part of release:prepare.

          The scenario is this:

          • module projects are executed with existing default goals (clean integration-test)
          • deployment module gets executed which has an assembly which attempts to collect all the previous module artifact's and place them into a distributable archive.

          The deployment module will fail since none of the artifacts are available in the local repository.

          According to http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html:
          "package" < "integration-test" < "install" and hence the deployment module will cause failures in the release process.

          My workaround is to manually run mvn install when the release process fails and then to restart the release.

          Show
          Barrie Treloar added a comment - MRELEASE-182 (release:prepare preparationGoals should be "clean verify") may be related to this issue. I disagree with the recommendation in MRELEASE-182 as I believe that "install" needs to happen as part of release:prepare. The scenario is this: module projects are executed with existing default goals (clean integration-test) deployment module gets executed which has an assembly which attempts to collect all the previous module artifact's and place them into a distributable archive. The deployment module will fail since none of the artifacts are available in the local repository. According to http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html: "package" < "integration-test" < "install" and hence the deployment module will cause failures in the release process. My workaround is to manually run mvn install when the release process fails and then to restart the release.
          Hide
          Emmanuel Venisse added a comment -

          John, I think this problem is fixed in latest code. Can you verify?

          Show
          Emmanuel Venisse added a comment - John, I think this problem is fixed in latest code. Can you verify?
          Hide
          Damien Lecan added a comment -

          Snapshot of the plugin from rev 530675 doesn't need to have artifacts in the local repository.

          Good job

          Show
          Damien Lecan added a comment - Snapshot of the plugin from rev 530675 doesn't need to have artifacts in the local repository. Good job
          Hide
          Sundeep Sharma added a comment -

          I am facing same issue with 2.0.6.

          Show
          Sundeep Sharma added a comment - I am facing same issue with 2.0.6.
          Hide
          Kuno Baeriswyl added a comment -

          I think I got the same problem with Maven 2.0.8

          Show
          Kuno Baeriswyl added a comment - I think I got the same problem with Maven 2.0.8
          Hide
          Dan Tran added a comment -

          Dont think it is fixed, my maven is 2.0.9 using release plugin that binds with the maven version.

          Show
          Dan Tran added a comment - Dont think it is fixed, my maven is 2.0.9 using release plugin that binds with the maven version.
          Hide
          Dan Tran added a comment -

          I made an attempt to do a test release:prepare of surefire ( ofcourse with network cutoff) and no local artifacts

          mvn release:prepare -P -DpreparationGoals=clean"

          It went fine ( fails at expected svn commit ).

          So the problem is little more troubling, could be due to the way I setup up my company maven project which is much bigger then surefire.

          Show
          Dan Tran added a comment - I made an attempt to do a test release:prepare of surefire ( ofcourse with network cutoff) and no local artifacts mvn release:prepare -P -DpreparationGoals=clean" It went fine ( fails at expected svn commit ). So the problem is little more troubling, could be due to the way I setup up my company maven project which is much bigger then surefire.
          Hide
          Olivier Lamy added a comment -

          IMHO it's more a MNG issue.
          If you run your project with clean verify, with a clean repo and no modules deployed as a SNAPSHOT, it will fail too.
          SO use -DpreparationGoals="clean install"

          Show
          Olivier Lamy added a comment - IMHO it's more a MNG issue. If you run your project with clean verify, with a clean repo and no modules deployed as a SNAPSHOT, it will fail too. SO use -DpreparationGoals="clean install"
          Hide
          Dan Tran added a comment -

          setting preparationGoals="clean install" will work, but for a large project with daily release, the build time is double.

          Show
          Dan Tran added a comment - setting preparationGoals="clean install" will work, but for a large project with daily release, the build time is double.
          Hide
          Olivier Lamy added a comment -

          IMHO again it's more a MNG issue !

          Show
          Olivier Lamy added a comment - IMHO again it's more a MNG issue !
          Hide
          Job de Noo added a comment -

          have te same issue that it will not resolve reactor dependencies in maven 2.2

          Show
          Job de Noo added a comment - have te same issue that it will not resolve reactor dependencies in maven 2.2
          Hide
          Youri De Bondt added a comment - - edited

          -DpreparationGoals="clean install" doesn't work for me.
          I have to perform a clean install first, then release:prepare (which will check if the modules are installed, and also runs clean install)

          Show
          Youri De Bondt added a comment - - edited -DpreparationGoals="clean install" doesn't work for me. I have to perform a clean install first, then release:prepare (which will check if the modules are installed, and also runs clean install)
          Hide
          Brett Porter added a comment -

          See the following thread for the planned resolution to this: http://mail-archives.apache.org/mod_mbox/maven-dev/201001.mbox/%3C4B56E5A7.9050806@udo.edu%3E

          Show
          Brett Porter added a comment - See the following thread for the planned resolution to this: http://mail-archives.apache.org/mod_mbox/maven-dev/201001.mbox/%3C4B56E5A7.9050806@udo.edu%3E

            People

            • Assignee:
              Brett Porter
              Reporter:
              John Casey
            • Votes:
              20 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: