gradle-pluginmaven-release-plugingradle-release-plugin

Gradle Release Plugin for functionalities like Maven release


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


Solution

  • 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.