Maven 2.x Release Plugin

release:prepare should support a nested/flat hybrid SCM structure

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.0-beta-9
  • Fix Version/s: None
  • Component/s: perform, prepare
  • Testcase included:
    yes
  • Description:
    Hide

    This issue is related to MRELEASE-261 in that release prepare is having some difficulty in dealing with certain SCM structures during the prepare goal. Our project structure is flat as you would see in a typical IDE setup:

    release-workspace\
            |
            |--release-parent
            |    |+pom.xml (modules: ../release-module1, ../release-module2)
            |
            |--release-module1
            |    |+pom.xml (parent: ../release-parent)
            |
            |--release-module2
                 |+pom.xml (parent: ../release-parent)
    

    Our SCM (svn) structure is as follows:

    svnroot
    |
    +--release-parent/trunk/pom.xml
    +--release-parent/tags/release-parent-1.0.9/pom.xml
    |
    +--release-module1/trunk/pom.xml
    +--release-module1/tags/release-module1-1.0.9/pom.xml
    |
    +--release-module1/trunk/pom.xml
    +--release-module2/tags/release-module2-1.0.9/pom.xml
    

    If we execute release:prepare with no configuration to the release plugin, we get the following error:

    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] Checking in modified POMs...
    [INFO] Executing: /bin/sh -c cd /Users/emiles/Projects/release-workspace/release-parent && svn --non-interactive commit --file /var/folders/fH/fHNZYBGdFd0bMMIPiloA2U+++TI/-Tmp-/maven-scm-1253932520.commit --targets /var/folders/fH/fHNZYBGdFd0bMMIPiloA2U+++TI/-Tmp-/maven-scm-4376558781490229966-targets
    [INFO] Working directory: /Users/emiles/Projects/release-workspace/release-parent
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Unable to commit files
    Provider message:
    The svn command failed.
    Command output:
    svn: '/Users/emiles/Projects/release-workspace' is not a working copy
    

    If we use the 2.0-beta-10-SNAPSHOT with flat project support and provide the -DcommitByProject=true JVM parameter, we do not get any errors, however tagging does not happen as expected. Rather than having tags for each of the projects, some odd tagging happened at the parent level where an entire structure was created (with branches, tags and trunk under the tag folder). I'm attaching a screen shot for reference.

    Ignoring the fact that the prepare only somewhat worked, when I attempted to perform the release, I get an error:

    emiles-macbook:release-parent emiles$ mvn release:perform -DcommitByProject=true
    [INFO] Scanning for projects...
    [INFO] Reactor build order: 
    [INFO]   Unnamed - com.captechventures:release-parent:pom:0.0.3-SNAPSHOT
    [INFO]   Unnamed - com.captechventures:release-module1:jar:0.0.3-SNAPSHOT
    [INFO]   Unnamed - com.captechventures:release-module2:jar:0.0.3-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - com.captechventures:release-parent:pom:0.0.3-SNAPSHOT
    [INFO]    task-segment: [release:perform] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] [release:perform {execution: default-cli}]
    [INFO] Checking out the project to perform the release ...
    [INFO] Executing: /bin/sh -c cd /Users/emiles/Projects/release-workspace/release-parent/target && svn --non-interactive checkout http://localhost/dev/release-parent/tags/release-parent-0.0.2 /Users/emiles/Projects/release-workspace/release-parent/target/checkout
    [INFO] Working directory: /Users/emiles/Projects/release-workspace/release-parent/target
    [INFO] Executing goals 'deploy'...
    [WARNING] Base directory is a file. Using base directory as POM location.
    [WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error executing Maven.
    
    Working directory "/Users/emiles/Projects/release-workspace/release-parent/target/checkout/Users/emiles/Projects/release-workspace/release-parent" does not exist!
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5 seconds
    [INFO] Finished at: Mon Jan 04 12:22:31 EST 2010
    [INFO] Final Memory: 11M/20M
    [INFO] ------------------------------------------------------------------------
    

    Although this isn't the flat model as identifed in MRELEASE-261, I feel this flat structure should be supported as all the relevant SCM metadata is included in each POM so the plugin should have no difficulty determining where to check stuff into SCM.

    Show
    This issue is related to MRELEASE-261 in that release prepare is having some difficulty in dealing with certain SCM structures during the prepare goal. Our project structure is flat as you would see in a typical IDE setup:
    release-workspace\
            |
            |--release-parent
            |    |+pom.xml (modules: ../release-module1, ../release-module2)
            |
            |--release-module1
            |    |+pom.xml (parent: ../release-parent)
            |
            |--release-module2
                 |+pom.xml (parent: ../release-parent)
    
    Our SCM (svn) structure is as follows:
    svnroot
    |
    +--release-parent/trunk/pom.xml
    +--release-parent/tags/release-parent-1.0.9/pom.xml
    |
    +--release-module1/trunk/pom.xml
    +--release-module1/tags/release-module1-1.0.9/pom.xml
    |
    +--release-module1/trunk/pom.xml
    +--release-module2/tags/release-module2-1.0.9/pom.xml
    
    If we execute release:prepare with no configuration to the release plugin, we get the following error:
    [INFO] [INFO] ------------------------------------------------------------------------
    [INFO] Checking in modified POMs...
    [INFO] Executing: /bin/sh -c cd /Users/emiles/Projects/release-workspace/release-parent && svn --non-interactive commit --file /var/folders/fH/fHNZYBGdFd0bMMIPiloA2U+++TI/-Tmp-/maven-scm-1253932520.commit --targets /var/folders/fH/fHNZYBGdFd0bMMIPiloA2U+++TI/-Tmp-/maven-scm-4376558781490229966-targets
    [INFO] Working directory: /Users/emiles/Projects/release-workspace/release-parent
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Unable to commit files
    Provider message:
    The svn command failed.
    Command output:
    svn: '/Users/emiles/Projects/release-workspace' is not a working copy
    
    If we use the 2.0-beta-10-SNAPSHOT with flat project support and provide the -DcommitByProject=true JVM parameter, we do not get any errors, however tagging does not happen as expected. Rather than having tags for each of the projects, some odd tagging happened at the parent level where an entire structure was created (with branches, tags and trunk under the tag folder). I'm attaching a screen shot for reference. Ignoring the fact that the prepare only somewhat worked, when I attempted to perform the release, I get an error:
    emiles-macbook:release-parent emiles$ mvn release:perform -DcommitByProject=true
    [INFO] Scanning for projects...
    [INFO] Reactor build order: 
    [INFO]   Unnamed - com.captechventures:release-parent:pom:0.0.3-SNAPSHOT
    [INFO]   Unnamed - com.captechventures:release-module1:jar:0.0.3-SNAPSHOT
    [INFO]   Unnamed - com.captechventures:release-module2:jar:0.0.3-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - com.captechventures:release-parent:pom:0.0.3-SNAPSHOT
    [INFO]    task-segment: [release:perform] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] [release:perform {execution: default-cli}]
    [INFO] Checking out the project to perform the release ...
    [INFO] Executing: /bin/sh -c cd /Users/emiles/Projects/release-workspace/release-parent/target && svn --non-interactive checkout http://localhost/dev/release-parent/tags/release-parent-0.0.2 /Users/emiles/Projects/release-workspace/release-parent/target/checkout
    [INFO] Working directory: /Users/emiles/Projects/release-workspace/release-parent/target
    [INFO] Executing goals 'deploy'...
    [WARNING] Base directory is a file. Using base directory as POM location.
    [WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error executing Maven.
    
    Working directory "/Users/emiles/Projects/release-workspace/release-parent/target/checkout/Users/emiles/Projects/release-workspace/release-parent" does not exist!
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5 seconds
    [INFO] Finished at: Mon Jan 04 12:22:31 EST 2010
    [INFO] Final Memory: 11M/20M
    [INFO] ------------------------------------------------------------------------
    
    Although this isn't the flat model as identifed in MRELEASE-261, I feel this flat structure should be supported as all the relevant SCM metadata is included in each POM so the plugin should have no difficulty determining where to check stuff into SCM.
  • Environment:
    OS X 10.5.8, Windows XP Prof, JDK 1.5.0_12, SVN, GIT, CVS
  1. maven-release-issue.zip
    (1 kB)
    Eric Miles
    20/Jan/10 8:03 AM
  1. odd-tags.png
    (24 kB)

Issue Links

Activity

Hide
Subir S added a comment - 21/Jan/10 4:07 AM

Also the scm-tag of the parent pom is only available in the release.properties.
Modules get mostly the scm-tag as HEAD. This may not work with all VCS. I have synergy and we also intend to use this flat structure due to maintanence complexities.

I tried with Dproject.scm.c.o.m\:module_child.tag=module_child<tagVersion> but that is not respected by release:prepare.

All the submodules have SCM elements declared separately in their POMs.

Show
Subir S added a comment - 21/Jan/10 4:07 AM Also the scm-tag of the parent pom is only available in the release.properties. Modules get mostly the scm-tag as HEAD. This may not work with all VCS. I have synergy and we also intend to use this flat structure due to maintanence complexities. I tried with Dproject.scm.c.o.m\:module_child.tag=module_child<tagVersion> but that is not respected by release:prepare. All the submodules have SCM elements declared separately in their POMs.
Hide
Erik Magnusson added a comment - 24/Mar/10 1:29 AM - edited

I would like to add that it would be desirable if this could also support the case where the modules do not have the aggregator pom as their parent, i.e. the following scenario:

release-workspace\ 
        | 
        |--release-parent 
        |    |+pom.xml (modules: ../release-module1, ../release-module2) 
        | 
        |--release-module1 
        |    |+pom.xml (parent: corporate root pom) 
        | 
        |--release-module2 
             |+pom.xml (parent: some other parent)

We would like to have this set up in order to support a collective release consisting of a dynamic set of modules (the list of modules in the aggregator pom is dynamically generated from a dialog where you can choose which modules to release at a particular time).

The release cycle for these modules may or may not coincide at any point in time, it depends entirely on which features should be pushed to production, and we want this flexible workflow. (And we certainly do not want to release every module independently since it can be up to 30-40 modules and releases can be as frequent as every week.)

Also, it would be ideal if any SCM structure could be supported (since SCM information is readily available in each module's pom anyway), e.g. the modules above might look like this in the repo:

repo-root\ 
        | 
        |--release-parent\trunk 
        |                 |+pom.xml (modules: ../release-module1, ../release-module2) 
        | 
        |--subdirectory1\ 
        |    | 
        |    |----release-module1\trunk 
        |                         |+pom.xml (parent: corporate root pom) 
        | 
        |--release-module2\trunk 
                           |+pom.xml (parent: some other parent)
Show
Erik Magnusson added a comment - 24/Mar/10 1:29 AM - edited I would like to add that it would be desirable if this could also support the case where the modules do not have the aggregator pom as their parent, i.e. the following scenario:
release-workspace\ 
        | 
        |--release-parent 
        |    |+pom.xml (modules: ../release-module1, ../release-module2) 
        | 
        |--release-module1 
        |    |+pom.xml (parent: corporate root pom) 
        | 
        |--release-module2 
             |+pom.xml (parent: some other parent)
We would like to have this set up in order to support a collective release consisting of a dynamic set of modules (the list of modules in the aggregator pom is dynamically generated from a dialog where you can choose which modules to release at a particular time). The release cycle for these modules may or may not coincide at any point in time, it depends entirely on which features should be pushed to production, and we want this flexible workflow. (And we certainly do not want to release every module independently since it can be up to 30-40 modules and releases can be as frequent as every week.) Also, it would be ideal if any SCM structure could be supported (since SCM information is readily available in each module's pom anyway), e.g. the modules above might look like this in the repo:
repo-root\ 
        | 
        |--release-parent\trunk 
        |                 |+pom.xml (modules: ../release-module1, ../release-module2) 
        | 
        |--subdirectory1\ 
        |    | 
        |    |----release-module1\trunk 
        |                         |+pom.xml (parent: corporate root pom) 
        | 
        |--release-module2\trunk 
                           |+pom.xml (parent: some other parent)

People

  • Assignee:
    Unassigned
    Reporter:
    Eric Miles
  • Votes:
    9
    Watchers:
    13

Dates

  • Created:
    20/Jan/10 8:03 AM
    Updated:
    24/Mar/10 1:30 AM