worflow

  • Here is a solution to the following problems

    • Deriving Maven artifact version from GIT branch,
    • Update pom version on GIT checkout automatically,
    • Add the ability to use Pull request with Apache Maven.

    You have a workflow requirement that require you to have the artifact version of a module externally defined from the current branch in GIT.

    For example

    You want to start working on a new feature branch “feature-memory-improvement”, so you branch from master a new branch named feature/feature-memory-improvement

    Having unique snapshot is a something you need to share your code using a Maven repository, so you may want to have into the branch all pom.xml version changed to

    <version>FEATURE-MEMORY-IMPROVEMENT-SNAPHOTS</version>

    changing all your pom.xml and doing a technical commit&160; will create merge conflicts when using pull request!

    One solution, while not perfect is to do the following:&160; You can add a separate execution to run a goal which will change the version of the POM automatically in the Maven reactor. This small script will do it¨