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

release:prepare failed in 'cvs ... commit' phase for multi-module build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-4
    • 2.0-beta-5
    • scm
    • None
    • redhat linux, cvs 1.11.17, maven 2.0.4

    Description

      I have a multi-module setup

      parent-module
      child-module-1
      child-module-2
      ...

      In CVS, they are peer, to establish the parent-child layout, manually first check out
      . parent-module (which has only the pom.xml)
      then 'cd to parent-module' and manually check out each of the child module (using 'cvs co -d outputDir module_name)

      when I use 'release:prepare', Maven2 failed at the 'commit phase'. After playing with the 'cvs commit ...' it appears that changing the order the 'list of modified POM's' gives different results. One that allow an OK 'commit' involves ordering the list of the modified POM's so that the parent POM is first in the list.

      It does look as if this is a cvs-specific issue but if we can do something to help as work-around, that will be great. I did quick experiment by modifying ScmCommitPhase.java. In method createPomFiles(reactorProjects), sort the list before returning and it did let me complete the release:prepare step:

      // hle@comergent.com
      System.out.println("preSorted, pomFiles=" + pomFiles);
      boolean sortPomFiles = true;
      if (sortPomFiles) {
      Comparator comp = new Comparator() {
      public int compare(Object o1, Object o2) {
      File f1 = (File) o1;
      File f2 = (File) o2;

      String str1 = f1.getAbsolutePath();
      String str2 = f2.getAbsolutePath();

      int rv = (str1.length() - str2.length());
      if (rv == 0)

      { rv = f1.compareTo(f2); }

      return rv;
      }
      };
      Collections.sort(pomFiles, comp);
      }
      System.out.println("postSorted, pomFiles=" + pomFiles);

      Attachments

        Issue Links

          Activity

            People

              evenisse Emmanuel Venisse
              hle hle
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: