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

Filter reactor projects that are concerned by a submodule branch operation

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: branch
    • Labels:
      None
    • Flags:
      Patch

      Description

      We have the requirement to create a separate branch of one submodule when releasing the entire project. We solved this with the follwoing config in pom.xml of concerned submodule:

      <profile>
        <id>branchSubModule</id>
        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <inherited>false</inherited>
              <executions>
                <execution>
                  <id>explorer-branch</id>
                  <inherited>false</inherited>
                  <phase>package</phase>
                  <goals>
                    <goal>branch</goal>
                  </goals>
                  <configuration>
                    <branchName>re${project.version}-submodule</branchName>
                    <developmentVersion>${project.version}</developmentVersion>
                    <updateBranchVersions>true</updateBranchVersions>
                    <releaseVersion>${project.version}-00-SNAPSHOT</releaseVersion>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </build>
      </profile>
      

      We launch the release build of parent project with:

      mvn release:prepare release:perform -DreleaseProfiles=branchSubModule

      Beside issue adressed by MRELEASE-619, we also face the problem that all submodules are affected when our special submodule gets branched.

      We solved this issue by filtering reactor projects with the current working path.

        Issue Links

          Activity

          Mark Thomas made changes -
          Workflow jira [ 12962390 ] Default workflow, editable Closed status [ 13000449 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:52:26 UTC 2015 [ 1428281546237 ]
          Mark Thomas made changes -
          Patch Submitted Yes [ 10763 ]
          Flags Patch [ 10430 ]
          Mark Thomas made changes -
          Workflow jira [ 12724466 ] Default workflow, editable Closed status [ 12763646 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 12:15:05 UTC 2015 [ 1428236105845 ]
          Hide
          Robert Scholte added a comment -

          I have my doubts about this patch. This implementation won't work for flat multi-modules projects.
          Also, I don't think that nesting the release-plugin (that's what is actually happening here) is a good idea.
          IMO you should use the maven-invoker-plugin to fork a new Maven-call for the branch.

          Show
          Robert Scholte added a comment - I have my doubts about this patch. This implementation won't work for flat multi-modules projects. Also, I don't think that nesting the release-plugin (that's what is actually happening here) is a good idea. IMO you should use the maven-invoker-plugin to fork a new Maven-call for the branch.
          Robert Scholte made changes -
          Description We have the requirement to create a separate branch of one submodule when releasing the entire project. We solved this with the follwoing config in pom.xml of concerned submodule:

          <profile>
            <id>branchSubModule</id>
            <build>
              <plugins>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-release-plugin</artifactId>
                  <inherited>false</inherited>
                  <executions>
                    <execution>
                      <id>explorer-branch</id>
                      <inherited>false</inherited>
                      <phase>package</phase>
                      <goals>
                        <goal>branch</goal>
                      </goals>
                      <configuration>
                        <branchName>re${project.version}-submodule</branchName>
                        <developmentVersion>${project.version}</developmentVersion>
                        <updateBranchVersions>true</updateBranchVersions>
                        <releaseVersion>${project.version}-00-SNAPSHOT</releaseVersion>
                      </configuration>
                    </execution>
                  </executions>
                </plugin>
              </plugins>
            </build>
          </profile>

          We launch the release build of parent project with:

          mvn release:prepare release:perform -DreleaseProfiles=branchSubModule

          Beside issue adressed by MRELEASE-619, we also face the problem that all submodules are affected when our special submodule gets branched.

          We solved this issue by filtering reactor projects with the current working path.
          We have the requirement to create a separate branch of one submodule when releasing the entire project. We solved this with the follwoing config in pom.xml of concerned submodule:
          {code:xml}
          <profile>
            <id>branchSubModule</id>
            <build>
              <plugins>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-release-plugin</artifactId>
                  <inherited>false</inherited>
                  <executions>
                    <execution>
                      <id>explorer-branch</id>
                      <inherited>false</inherited>
                      <phase>package</phase>
                      <goals>
                        <goal>branch</goal>
                      </goals>
                      <configuration>
                        <branchName>re${project.version}-submodule</branchName>
                        <developmentVersion>${project.version}</developmentVersion>
                        <updateBranchVersions>true</updateBranchVersions>
                        <releaseVersion>${project.version}-00-SNAPSHOT</releaseVersion>
                      </configuration>
                    </execution>
                  </executions>
                </plugin>
              </plugins>
            </build>
          </profile>
          {code}
          We launch the release build of parent project with:

          {{mvn release:prepare release:perform -DreleaseProfiles=branchSubModule}}

          Beside issue adressed by MRELEASE-619, we also face the problem that all submodules are affected when our special submodule gets branched.

          We solved this issue by filtering reactor projects with the current working path.
          lweller made changes -
          Field Original Value New Value
          Link This issue depends upon MRELEASE-619 [ MRELEASE-619 ]
          Lucien Weller created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Lucien Weller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development