Posts tagged maven
I had been preparing a new Struts 2 release for last few weeks. It contains only a tiny change regarding security and I had been counting that it shouldn’t take more than a week to release it. How wrong I was 😉http://visualcage.ru
Everything had started smoothly, I’ve created a new Subversion branch, to not interfere with current on-going development of the new Struts 2.2.2. The branch was made from Subversion tag (yeah, branches, tags and trunks are all the same, just copies 😉 ). Next, I’ve applied a patch to solve the security hole and I was truly sure that’s it – I can start the release process. So I’ve gone ahead, mvn release:prepare command went smoothly, so the next step was mvn release:perform. And after almost waiting 1h I’ve got a strange looking massage: not all licenses were approved !?!
The first thought, I’m using the latest Maven 3.0.1 and that’s the problem, but it wasn’t. I started looking into RAT plugin source code to check what could be wrong. I’ve just discovered that the plugin is checking wrong Apache License header but also looking for the License’s URL so it should be ok. The origin of the problem was quite simple. The Maven Release plugin allows to make release only from a SNAPSHOT version, so I’ve changed the version only in the parent pom of the project. The rest was unmodified. After changing all the version signatures in all the poms the problem was gone 😉
To launch another release process I’ve had to rollback all the changes made during previous launching release command. mvn release:rollback did the job but I’ve had to manually remove the tag from Subversion repository. And of course I’ve removed the wrong one 🙁
Thanks to Wes for a tip how to rollback such a huge mistake, the command looks like this:
TAG_1 is the removed tag, number 10 is the revision -1 when the tag was removed.film The Bye Bye Man streaming
So I’ve started again, to make a release and again something went wrong. I noticed the release plugin is making a tag base on wrong path – it was using the original path of the tag from which the branch was made of instead the branch path. And again I’ve had to rollback all changes and remove the tag – this time the correct one 😉
Resolution was easy – change scm tag in all the poms to point to the branch 😛
And again, I’ve started the release process and this time everything went more than smoothly, all the artifacts were uploaded to Apache Nexus, so the last think before calling a vote was to close a staging repository. And again I was wrong, during that, Nexus reported that two jar files don’t have corresponding files with signature. I’ve checked locally and everything was ok. After short conversation with guys from support, I’ve got the solution – upgrade to latest Apache Parent 🙂
Yep, easy, but to do that I’ve had to once again rollback everything, prepare a new Struts Parent that will inherit from the latest Apache Parent, release it and call for a vote 😀
Finally, after almost 2 months I was able to release Struts 22.214.171.124 – the vote is under way, so if you are Struts PMC, please test the release and vote!
Just to relax a bit, take a time and watch that very inspiring talk about camels:
The “Frozen Zone” was still On, so I had lot of time to contribute to Open Source project – in my case Apache Struts. I’ve been working for few weeks with Maven 2 archetypes, to updated them to latest Strust 2 version. It was quite easy task, I even wrote a simple bash script for automatically testing them.
Nevertheless, became the time when I had to release them – or to be more precise – prepare staging release. I never had been doing that, so always is the first time 😀
I’ve read some tutorials about releasing projects with Maven and there is also a great documentation entry on Apache Struts site about releasing the project. It was the most helpful information. Equipped with knowledge I started the release process. The first three archetypes were released very fast and without any problems (except conflict between Cygwin and Subversion client – next time I will use Linux box 😉 ).
Yap, I thought I’m on the road and then I got problem with checking out tagged project from Subversion. I don’t remember what was the message, but I spent more than hour to solve that problem! Another experience for future.
The whole release process took mi around 5-6 hours so it was enormous achievement in my opinion. The next time it will be faster 😉 And the last thing – the Vote! I started it and was able to relax with cold beer 😀
I spent the whole day working with Apache Struts 2 Maven archetypes – it’s an open source project hosted at struts.apache.org – basically Action Base Java Web framework.
During that I discovered strange Maven behaviour – when I lunched it with -o option (work in offline mode) it wasn’t be able to find installed archetypes. To clarify – I prepared a script that will build up the archetype from source code, install it in my local Maven repository, then create basic application base on that archetype and lunch them, the source is below:
#!/bin/sh if [ -e demo ] ; then rm -R demo fi cd $1 mvn clean install cd .. mvn -o archetype:generate -DgroupId=org.demo -DartifactId=demo -Dversion=1.0-SNAPSHOT -DpackageName=org.demo -DarchetypeArtifactId=$1 -DarchetypeGroupId=org.apache.struts -DarchetypeVersion=2.1.8 -DinteractiveMode=false cd demo mvn jetty:run cd ..
$1 – it’s a command line parameter specifying archetype folder which is also archetype name
So it shouldn’t be needed to access remote archetype repository to download archetype – it’s already in local repository! I tried that with different Maven versions – the latest 2.2.1 and with 2.0.10 – with both was the same.
After some time and many experiments I found the solution – do not use -o option used -B instead! And that I was able to test one archetype – another 3 are waiting!