I just can't see the point in the Maven Release plugin. Quite frankly I just can't see what value it adds to a Maven 2 project.
Well, yeh. Thats its selling point, right? In fact, one of the first things you read when you visit its homepage is
This plugin is used to release a project with Maven,
saving a lot of repetitive, manual work.
Well, yeh, it kinda does. But only if you do things the way that the Maven Release plugin wants you to do things. But the Maven Release plugin fails because it either makes some pretty silly assumptions about your release process, or it doesn't add any value over what other Maven plugins give you already.
My issue with this plugin is not that it doesn't add any value. My issue is that it doesn't add enough value to justify the restrictions it tries to impose on your release process.
Having used the Maven Release plugin to perform some releases, and having talked to another developer who has used it rather more extensively, and having read through the doco on its site, I came up with this brief list of the key value adds that the Maven Release plugin provides in order to "simplify" the release process.
This plugin saves you the hassle of creating a SVN tag of your codebase for releasing from. Thing is that, if you are running a CI environment (as all good software projects should be) and you are ensuring good test coverage of your application (once again, as all good software projects should be) then you really should be hooking something like the Maven SCM Plugin to automatically tag your codebase everytime you have a green build in your CI environment. This, in conjunction with my next point, are the two critical reasons why I do not need the Maven Release plugin. If my build is already creating a tag of my codebase whenever a build is successfully completed, then why do I need to use the Maven Release plugin to create me yet another tag?
Yes it does. But all of my tests have already been run! If I have setup my CI build to automatically tag all green builds, and I use one of these tags to release from, then why do I need to re-run my tests again as part of the Maven release process? The only reason why the build is green is because all my tests passed the first time. Why run all my tests again against the same version of the code? Its just a waste of time ...
Also, from a practical point of view, any meaningful test suite will take a significant time to run. Our build takes over 2 hours to run all unit, integration and acceptance tests (thanks to the wonders of the Selenium project). Imagine having to sit through even a half hour build just to release. And, if you are releasing from Trunk (which the Maven Release plugin seems to assume you are) then there is every possibility that some joker has just committed a change that will break your build when you have 5 minutes left to run. Are you seriously going to take that risk when you have to do a release right now? Or would you rather a pre-tagged version that you can release from immediately? I know which one I would prefer ...
So it does. But so what? So does the Maven Version plugin, of which this plugin probably calls under the covers. In fact, we execute this Maven Version plugin manually ourselves as part of our release process. Its an extra step in our release process and consists of running the following line on a checked out version of the tag:
mvn versions:set -DnewVersion=[VERSION NUMBER]Not exactly mind-boggling stuff. Automating this step is not enough of a reason for me to choose the Maven Release plugin.
Well, first of all. If you're building a webapp, you probably don't need it to deploy to a maven repository. So no value add there. And even if you are building a library that other projects would benefit from, then why not just use the Maven Deploy Plugin to do it? I mean, thats probably what it does under the covers, right? Its like using a sledgehammer to crack a nut (i got that little gem from here)...
Like my last point above, I acknowledge that the Maven Release plugin does automate this. So, it provides a little value add there. But once again, like the last point above, I don't feel this outweighs the drawbacks of my first two points.
Well, i suppose it may have its uses. It maybe useful if you enjoy taking the risk of sitting through all of your tests everytime you want to release. If you enjoy the long build times everytime you want to release. If you don't already tag every green build. If you feel that using Maven Version plugin is too "manual" and need something to automatically increment your version numbers for you. If you actually need to deploy to a remote maven repository and running the Deploy plugin is once again too much hassle ....
So yeh, cutting through all the sarcasm in the last paragraph ... I guess what I'm saying is that it is entirely crap.
... the fact that I usually need to run database migrations as part of a release. Of which I DEFINITELY want to run these manually to ensure that I hit the right schemas. There is no way in heck that I would automate the running of my database migrations. The risks are just too great. So that is yet another aspect of releases that no plugin will ever automate for me...
I don't see any point in using the Maven Release plugin. Full Stop.
Comments ...
do see some use for it based on what you described. Here is a scenario I would
like to happen.
For iteration base release I would like to be able to do acceptance release and
staging releases.
With acceptance release, I would like maven to run all the test, deploy to
acceptance and create an acceptance branch as well as upgrade my db.
With staging release, I would like it to build from the acceptance branch,
test, deploy and branch as staging.
For production I would like to to just build me a war file based up on staging,
tag and create db migrate scripts so I can just give it to the infrastruture
guy.
The release plugin sounds like a consolidation of other plugins and might have
the same flexibility. But then again, maven is never about flexibility right?
Your maths questions are getting harder!!
the maven release to do production releases. And it still doesn't address the
issue of the time taken to run all your tests everytime you build.
But I just re-read my post, and I don't know why I feel soo strongly against
this plugin. Its not like it has committed murder... And not like anyone is
forcing me to use it ... hmmmm... perhaps it could be the client that I'm
working for, and not the plugin itself, that elicits soo much angst from me!?
going to fly well with large site deployment.
Can't you configure it to skip test?
from the working copy (usually trunk) then anyone could have committed in the
meantime so you should run tests. See how crap it is? And yeh, the site that
uses the Release plugin to do releases have the developers doing the releases.
Infrastructure doesn't do the releases. So they can get away with it cos there
aren't strict demarcations of roles when it comes to prod releases.... the
developers do everything!!! LOL.... and that is normal there cos, whilst the
place is a big organization, the IT department take a very chop-shop
approach...