We are working on multiple feature, one develop, release and master GIT branches. We create separate feature branches for all JIRA development task. I need to have Jenkins build job to poll all feature branch, and build those specific ones which have recent PUSH events. After the build job is initiated, I want that specific GIT feature branch name (i.e. JIRA-1234, not origin/feature/JIRA-1234) to be picked up, included this in artifact file name as APP-0.0.1-JIRA-1234-SNAPSHOT, and save this to Nexus.
NB: POM.XML file is configured with APP-0.0.1-SNAPSHOT.
For each feature branch build, we want separate jar files saved to Nexus. For ex: Development task under JIRA-0101 would build and save jar in nexus as APP-0.0.1-JIRA-0101-SNAPSHOT
I have included ${branch} parameter in POM.xml as shown below: APP-0.0.1${branch}-SNAPSHOT
and pass this value from Jenkins build command as - mvn clean install -Dbranch=-JIRA-0101
I then parametrised the jenkins build task, after which I can get feature branch name as "origin/feature/JIRA-0101", but I cannot parse this whole string in Jenkins to pick only JIRA task.
Secondly, mvn jgitflow:release-start and mvn jgitflow:release-finish commands would create complications having "APP-0.0.1${branch}-SNAPSHOT" in POM.xml. So, using ${branch} in POM is not effective.