Moving from Ant to Maven: Best Practices with Maven Plugins
I would like to share my experience of moving from "our reinventing wheel" of Ant build scripts to Maven standard. I reworked some apps which have following characteristics:
Java Version:
Basic technologies:
Packaging:
Test:
Optimization:
Quality check:
Deployment:
Development support:
Yes, our Ant scripts can do the (almost) whole things above. You can imagine how complex they are? Yes, everything are in the Ant scripts and you need to turn on/off the features you need. Remember how SAP works? Yes, we call this customizing! This is where I see the power of Maven. The plugin concept is just a better concept. Instead of having everything, we only have a small "core" and we add plugins on the top to fullfil our need. In case of the Ant scripts, you have everything (although you don't need all of them) and then you use switcher to turn them on and off.
So how did I solve the requirements above with Maven? Here they are, the plugins we need! In this article I just want to show you the plugins I used:
...
Continue read this article at: http://lofidewanto.blogspot.com/2011/06/moving-from-ant-to-maven-best-practices.html
...
As a conclusion I just can say, Maven and its plugin ecosystem are great. No matter how complex your project you can still handle it easily with Maven plugins. My lessons learned is that DO NOT REINVENTING WHEEL! There are a lot of good Maven plugins out there! In case you cannot find one, just use maven-antrun-plugin. You can almost do everything with it. Just don't forget that you don't want that chaos back to Ant, so use it with precautions.
... and to all other developers who still doing their own build processes... try Maven, you won't regret!
Discussion: so what are your experiences with Maven plugins? What are your favorites Maven plugins?
From http://lofidewanto.blogspot.com/2011/06/moving-from-ant-to-maven-best-practices.html
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)





Comments
Maheshkumar Per... replied on Wed, 2011/06/29 - 9:08pm
Its really nice article about maven-plugins for new users. Please update your blog if you come up with new plugins
Lance Semmens replied on Fri, 2011/07/01 - 7:05am
Did you consider Gradle instead of Maven? All the cool kids (Hibernate, Spring Integration, Spring Security etc) are doing it ;)
http://www.gradle.org
Lofi Dewanto replied on Mon, 2011/07/04 - 2:40pm
in response to:
Maheshkumar Periyasamy
Lofi Dewanto replied on Mon, 2011/07/04 - 2:49pm
in response to:
Lance Semmens
IMO adding new languages (DSL) will make everything much more complex and you have to find developers who know those languages. Also you need a good tooling support (editor, etc.), so this is not trivial at all...
If you have a developer team which is not always uptodate, just stay with Java and XML. I had some bad experiences with Groovy and our own DSL (using ANTLR).
So, just stay with XML (Maven) and in the future I hope that M2Eclipse will become better and better. At least it is now the part of Eclipse project (see Indigo Eclipse 3.7). So maybe you never had to edit those XML pom file, just edit it with the Eclipse editor ;-)
Lofi.
Sirikant Noori replied on Sun, 2012/01/15 - 12:05pm
Carla Brian replied on Wed, 2012/06/20 - 6:04pm