Reputation: 1287
I have a multiple maven projects in a single GIT repository .I wanted to perform individual release for the maven projects,push the release version to nexus, skip the tagging and increment the snapshot and commit.
Maven release goal used
release:clean release:prepare release:perform
Maven Release plugin :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven.releaseplugin.version}</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<releaseProfiles>releases</releaseProfiles>
</configuration>
</plugin>
Since the tagging happens to a repository i wanted to skip the tagging in GIT.We will do the tagging manually during code freeze window.
I would to avoid creating individual repository for the maven projects.
Can you please tell me how can i acheive it in better way.
I would also like to understand how it is managed in other companies.
Upvotes: 2
Views: 813
Reputation: 15316
The best (easiest and robust) way that I think is available with Maven & Nexus is:
VERSION=`mvn help:evaluate -Dexpression=project.version | grep -v "^\["| grep -v Download` VERSION=${VERSION/%-SNAPSHOT/} #get rid of -SNAPSHOT if it's there VERSION="$VERSION-"`date +"%Y%m%d.%H%M%S"`"-$BUILD_NUMBER" mvn versions:set -DnewVersion=$VERSION
Pros:
Upvotes: 1