Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Some files require version replacement beyond mvn versions:set. We are running a special version replace command as part of the release process (see http://apex.incubator.apache.org/release.html). This should be integrated in the Maven build.

      1. diff
        5 kB
        Chinmay Kolhatkar

        Issue Links

          Activity

          Hide
          thw Thomas Weise added a comment -

          For example, apex-conf-archetype/README.md contains the version number and this file should be part of the version bump process.

          Show
          thw Thomas Weise added a comment - For example, apex-conf-archetype/README.md contains the version number and this file should be part of the version bump process.
          Hide
          chenar Chetan Narsude added a comment -

          +1. maven-resource-plugin has support for it.

          Show
          chenar Chetan Narsude added a comment - +1. maven-resource-plugin has support for it.
          Hide
          thw Thomas Weise added a comment -

          Here is an example where the wrong version numbers in pom.xml were replaced.

          https://github.com/apache/incubator-apex-malhar/pull/17

          Show
          thw Thomas Weise added a comment - Here is an example where the wrong version numbers in pom.xml were replaced. https://github.com/apache/incubator-apex-malhar/pull/17
          Hide
          thw Thomas Weise added a comment -

          Should also use $

          {project.version}

          to refer to other modules that are in the same project and always at same version.

          https://github.com/apache/incubator-apex-core/pull/20

          Show
          thw Thomas Weise added a comment - Should also use $ {project.version} to refer to other modules that are in the same project and always at same version. https://github.com/apache/incubator-apex-core/pull/20
          Hide
          chinmay Chinmay Kolhatkar added a comment -

          One possible solution here is to have a unbound plugin to any phase in apex top level pom.xml as follows:

          <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <executions>
          <execution>
          <id>replaceTextVersions</id>
          <phase>none</phase>
          <configuration>
          <tasks>
          <replace token= "$

          {project.version}

          " value="$

          {newVersion}

          " dir="$

          {basedir}

          ">
          <include name="apex-app-archetype/README.md"/>
          <include name="apex-conf-archetype/README.md"/>
          </replace>
          </tasks>
          </configuration>
          <goals>
          <goal>run</goal>
          </goals>
          </execution>
          </executions>
          </plugin>

          The way to execute this is:
          mvn antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT

          This would have a cleaner way to change the versions in text files.

          So overall the steps to upgrade the version would look like this:
          mvn antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT
          mvn versions:set -DnewVersion=3.4.0-incubating-SNAPSHOT

          Thoughts?

          Show
          chinmay Chinmay Kolhatkar added a comment - One possible solution here is to have a unbound plugin to any phase in apex top level pom.xml as follows: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>replaceTextVersions</id> <phase>none</phase> <configuration> <tasks> <replace token= "$ {project.version} " value="$ {newVersion} " dir="$ {basedir} "> <include name="apex-app-archetype/README.md"/> <include name="apex-conf-archetype/README.md"/> </replace> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> The way to execute this is: mvn antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT This would have a cleaner way to change the versions in text files. So overall the steps to upgrade the version would look like this: mvn antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT mvn versions:set -DnewVersion=3.4.0-incubating-SNAPSHOT Thoughts?
          Hide
          thw Thomas Weise added a comment -

          That looks like a good solution as long as we reflect it in the release instructions. Any reason the 2 goals cannot be in a single command?

          Show
          thw Thomas Weise added a comment - That looks like a good solution as long as we reflect it in the release instructions. Any reason the 2 goals cannot be in a single command?
          Hide
          thw Thomas Weise added a comment -

          Did you confirm that after running the command all version strings have been replaced?

          Show
          thw Thomas Weise added a comment - Did you confirm that after running the command all version strings have been replaced?
          Hide
          chinmay Chinmay Kolhatkar added a comment -

          Yes you're right, we can merge the 2 mojos to be executed by a single command. So here is a single command which can be executed:

          mvn antrun:run@replaceTextVersions versions:set -DnewVersion=3.4.0-incubating-SNAPSHOT

          OR

          mvn versions:set antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT

          Order of mojos won't matter.

          Show
          chinmay Chinmay Kolhatkar added a comment - Yes you're right, we can merge the 2 mojos to be executed by a single command. So here is a single command which can be executed: mvn antrun:run@replaceTextVersions versions:set -DnewVersion=3.4.0-incubating-SNAPSHOT OR mvn versions:set antrun:run@replaceTextVersions -DnewVersion=3.4.0-incubating-SNAPSHOT Order of mojos won't matter.
          Hide
          chinmay Chinmay Kolhatkar added a comment -

          Yes I confirmed the single command mentioned above.
          After running the command following is the git status:
          ✔ ~/src/repos/apex [devel-3 ↓·2|✚ 9…7]
          10:26 $ git status -s
          M apex-app-archetype/README.md
          M apex-app-archetype/pom.xml
          M apex-conf-archetype/README.md
          M apex-conf-archetype/pom.xml
          M api/pom.xml
          M bufferserver/pom.xml
          M common/pom.xml
          M engine/pom.xml
          M pom.xml
          ?? apex-app-archetype/pom.xml.versionsBackup
          ?? apex-conf-archetype/pom.xml.versionsBackup
          ?? api/pom.xml.versionsBackup
          ?? bufferserver/pom.xml.versionsBackup
          ?? common/pom.xml.versionsBackup
          ?? engine/pom.xml.versionsBackup
          ?? pom.xml.versionsBackup
          ✔ ~/src/repos/apex [devel-3 ↓·2|✚ 9…7]
          10:26 $

          Diff is attached after executing the command.

          Show
          chinmay Chinmay Kolhatkar added a comment - Yes I confirmed the single command mentioned above. After running the command following is the git status: ✔ ~/src/repos/apex [devel-3 ↓·2|✚ 9…7] 10:26 $ git status -s M apex-app-archetype/README.md M apex-app-archetype/pom.xml M apex-conf-archetype/README.md M apex-conf-archetype/pom.xml M api/pom.xml M bufferserver/pom.xml M common/pom.xml M engine/pom.xml M pom.xml ?? apex-app-archetype/pom.xml.versionsBackup ?? apex-conf-archetype/pom.xml.versionsBackup ?? api/pom.xml.versionsBackup ?? bufferserver/pom.xml.versionsBackup ?? common/pom.xml.versionsBackup ?? engine/pom.xml.versionsBackup ?? pom.xml.versionsBackup ✔ ~/src/repos/apex [devel-3 ↓·2|✚ 9…7] 10:26 $ Diff is attached after executing the command.
          Hide
          chinmay Chinmay Kolhatkar added a comment -

          Diff after versions are all set.

          Show
          chinmay Chinmay Kolhatkar added a comment - Diff after versions are all set.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user chinmaykolhatkar opened a pull request:

          https://github.com/apache/incubator-apex-site/pull/10

          APEXCORE-34 Updated site for change in version replacement step for -core

          Updated steps to execute for version number replacement.

          @tweise Please review.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/chinmaykolhatkar/incubator-apex-site APEXCORE-34_versionReplacement

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/incubator-apex-site/pull/10.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #10


          commit ace65ec317a66524e138e68a8771bb0747836a93
          Author: chinmaykolhatkar <chinmay@datatorrent.com>
          Date: 2016-01-14T06:09:57Z

          APEXCORE-34 Updated site for change in version replacement step for -core.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user chinmaykolhatkar opened a pull request: https://github.com/apache/incubator-apex-site/pull/10 APEXCORE-34 Updated site for change in version replacement step for -core Updated steps to execute for version number replacement. @tweise Please review. You can merge this pull request into a Git repository by running: $ git pull https://github.com/chinmaykolhatkar/incubator-apex-site APEXCORE-34 _versionReplacement Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-apex-site/pull/10.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #10 commit ace65ec317a66524e138e68a8771bb0747836a93 Author: chinmaykolhatkar <chinmay@datatorrent.com> Date: 2016-01-14T06:09:57Z APEXCORE-34 Updated site for change in version replacement step for -core.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user chinmaykolhatkar opened a pull request:

          https://github.com/apache/incubator-apex-core/pull/207

          APEXCORE-34 Added plugin binding to no phase for version replacement in text files.

          Added an unbound plugin to any phase which can change the text versions from the files.

          @tweise Please review.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/chinmaykolhatkar/incubator-apex-core APEXCORE-34_VersionReplacement

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/incubator-apex-core/pull/207.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #207


          commit 83b50167b3907d327f193e709ff66aa8b098eeff
          Author: chinmaykolhatkar <chinmay@datatorrent.com>
          Date: 2016-01-14T05:47:42Z

          APEXCORE-34 Added plugin binding to no phase for version replacement in text files.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user chinmaykolhatkar opened a pull request: https://github.com/apache/incubator-apex-core/pull/207 APEXCORE-34 Added plugin binding to no phase for version replacement in text files. Added an unbound plugin to any phase which can change the text versions from the files. @tweise Please review. You can merge this pull request into a Git repository by running: $ git pull https://github.com/chinmaykolhatkar/incubator-apex-core APEXCORE-34 _VersionReplacement Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-apex-core/pull/207.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #207 commit 83b50167b3907d327f193e709ff66aa8b098eeff Author: chinmaykolhatkar <chinmay@datatorrent.com> Date: 2016-01-14T05:47:42Z APEXCORE-34 Added plugin binding to no phase for version replacement in text files.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user chinmaykolhatkar commented on the pull request:

          https://github.com/apache/incubator-apex-core/pull/207#issuecomment-173481554

          @tweise Can you please review and merge this once happy with the changes?

          Show
          githubbot ASF GitHub Bot added a comment - Github user chinmaykolhatkar commented on the pull request: https://github.com/apache/incubator-apex-core/pull/207#issuecomment-173481554 @tweise Can you please review and merge this once happy with the changes?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tweise commented on the pull request:

          https://github.com/apache/incubator-apex-core/pull/207#issuecomment-174673984

          I wonder if we can come up with a solution that combines the goals within pom.xml (in case for some reason we want to add another plugin goal in the future) and simplify the command the user runs. Also, please think about how this will affect a derived pom. Malhar will have different needs and not want to execute the added behavior.

          Here are a few related resources I found:

          http://stackoverflow.com/questions/16264059/maven-bind-plugin-execution-to-the-execution-of-another-plugin-not-to-a-lifecy
          http://stackoverflow.com/questions/1427740/how-do-i-execute-a-set-of-goals-before-my-maven-plugin-runs/1427783#1427783
          https://portals.apache.org/jetspeed-2/buildguide/the-need-for-a-custom-lifecycle.html

          Show
          githubbot ASF GitHub Bot added a comment - Github user tweise commented on the pull request: https://github.com/apache/incubator-apex-core/pull/207#issuecomment-174673984 I wonder if we can come up with a solution that combines the goals within pom.xml (in case for some reason we want to add another plugin goal in the future) and simplify the command the user runs. Also, please think about how this will affect a derived pom. Malhar will have different needs and not want to execute the added behavior. Here are a few related resources I found: http://stackoverflow.com/questions/16264059/maven-bind-plugin-execution-to-the-execution-of-another-plugin-not-to-a-lifecy http://stackoverflow.com/questions/1427740/how-do-i-execute-a-set-of-goals-before-my-maven-plugin-runs/1427783#1427783 https://portals.apache.org/jetspeed-2/buildguide/the-need-for-a-custom-lifecycle.html
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/incubator-apex-core/pull/207

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/incubator-apex-core/pull/207
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user sashadt commented on the pull request:

          https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181661775

          Unable to merge. Please update with respect to latest release.md

          Show
          githubbot ASF GitHub Bot added a comment - Github user sashadt commented on the pull request: https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181661775 Unable to merge. Please update with respect to latest release.md
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tweise commented on the pull request:

          https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181670109

          @chinmaykolhatkar please close this PR, you can reopen it once ready.

          Show
          githubbot ASF GitHub Bot added a comment - Github user tweise commented on the pull request: https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181670109 @chinmaykolhatkar please close this PR, you can reopen it once ready.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user chinmaykolhatkar commented on the pull request:

          https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181725435

          Closing this PR.. Will reopen when changes in core gets in.

          Show
          githubbot ASF GitHub Bot added a comment - Github user chinmaykolhatkar commented on the pull request: https://github.com/apache/incubator-apex-site/pull/10#issuecomment-181725435 Closing this PR.. Will reopen when changes in core gets in.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user chinmaykolhatkar closed the pull request at:

          https://github.com/apache/incubator-apex-site/pull/10

          Show
          githubbot ASF GitHub Bot added a comment - Github user chinmaykolhatkar closed the pull request at: https://github.com/apache/incubator-apex-site/pull/10

            People

            • Assignee:
              Unassigned
              Reporter:
              thw Thomas Weise
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Development