What is the equivalent to the maven release plugin in gradle?

I’ve seen several release plugins for gradle in my searches, but I wanted to know which is the best or most widely used? I am in the process of evaluating gradle and having an effective replacement for the maven release plugin is crucial.

Basically I’m just looking for the basic features whereby the snapshot version is stripped, the code is build, tagged and published to nexus, and finally the version is upgraded to the next snapshot version.

Also, if there is a better way of doing things than the maven release plugin, I’m open to that too!

1 Like

I’d start with combination of gradle-release and Gradle’s mavenDeployer. You can find various approaches listed here plus a presentation I gave in the past.

For Artifactory repos there’s a Gradle Artifactory Plugin available.

Any suggestions for versioning development branches (not tags)? Typically we have 3-4 parallel branches (with corresponding jenkins jobs) and we would like to make sure that the deployed artifacts does not get mixed up in artifactory.

As far as I can tell, there are 3 release plugins right now.

https://github.com/townsfolk/gradle-release https://github.com/ari/gradle-release-plugin https://github.com/stianh/gradle-release-plugin

The townsfolk plugin is the one that works the most like the maven plugin. If you like how the maven release plugin works, then this would probably be the plugin you are most comfortable with.

The other 2 plugins work much differently from the maven release plugin (and pretty similarly to each other)

These other two plugins use version control (svn/git) to keep track of version numbers instead of burying (and updating) version numbers in the build.gradle file.

Our team uses the ari release plugin because it fit our use case better and has more recent activity than the other stianh plugin.

1 Like

The townsfolk plugin does not “bury” the version number in the build.gradle file. It maintains a version property in gradle.properties.

The townsfolk plugin also deals with version control (tagging releases, etc.) and is the only one that supports Mercurial (which I consider a big plus) and Bazaar in addition to Subversion and Git. It also has the significantly more stars on GitHub.

The towsnfolk and ari release plugins are the only ones that seem to have relatively recent attention… though the townsfolk plugin has requested someone to take it over.

1 Like

I have been using mentioned townsfolk’s release plugin, but it is not actively developed anymore with a few open issues.

Recently I have found Axion release plugin which doesn’t use separate file to keep current version, but uses Git commits and tags to determine it. It simplifies releasing process and fits in Continuous Delivery trend. What is also very important the author is very responsible.

In addition to the README file nice description can be found on their blog.

The plugin can be used together with maven-publish, bintray or any other publishing plugin to push artifacts into remote artifacts repository.

2 Likes

I have just open-sourced my own release plugin recently: https://github.com/netzwerg/gradle-release-plugin

It is very simple and just does two things:

  • Initialization of project.version from version.txt file * Creation of tagged non-SNAPSHOT release (including preparation of version.txt for next SNAPSHOT iteration)

Please refer to the README for further details and configuration options.

The plugin is available on Bintray and I will happily incorporate feedback or feature requests!

1 Like