Reputation: 67
I am in the process of converting the existing maven project to Gradle for which I want to use alternative for maven release plugin. Mainly the functionality to remove snapshot and autoincrement by 1 once the release is cut. I came across to use researchgate gradle-release-plugin but need to identify how can I use to this to achieve maven like functionality described above.
I am trying for the first time and gone through below URL: https://github.com/researchgate/gradle-release
Upvotes: 3
Views: 3413
Reputation: 76799
It is called Maven Publish Plugin:
plugins {
id 'maven-publish'
}
When building with Jenkins, one can also pull in the build-number:
project.ext.set('build_number', System.getenv("BUILD_NUMBER") ?: "0")
Upvotes: 2
Reputation: 786
To automatically remove "-SNAPSHOT" and increment the version you can do gradle release -Prelease.useAutomaticVersion=true
and also additionally -Prelease.releaseVersion=1.0 -Prelease.newVersion=1.1-SNAPSHOT
to specify the next versions.
If you have a different versioning scheme you can change it too and with a regex + closure specify how to handle it. Check the "versionPatterns" for this.
Upvotes: 6