Maven: Lifecycle Hooks Lead To Infrequent Integrations
You could build, test and deploy the entire Java EE Application and even create a working application server from scratch with a single
mvm clean install command. The only problem is: it will take forever and you will have to repeat the whole process over and over again, even if you were only interested in particular build steps.
mvm clean install would just execute the unit tests, your feedback will be significantly faster. Instead of waiting hours, you get the first results in seconds.
A series of composable jobs, each executing a goal or maven plugin, could be realized with http://jenkins-ci.org, or a simple shell / batch script on the developer's machine.
Instead of executing all plugins at once by hooking them to the lifecycle, you could implement a series of chained together jobs. E.g.
mvm clean install(
mvn clean packagesuffices as well)
- Job: server setup
- Job: deployment
- Job: system test execution
- Job: quality assurance
- Job: promotion
- Job: tagging / release
The faster the feedback, the more valuable it gets. A monolithic
mvn clean install leads to too long builds, less feedback and becomes less valuable for Continuous Integration. CI degrades to nightly builds…
Just start with an essential setup essential and not with a super-pom.
[See also an in-depth discussion in the "Real World Java EE Night Hacks--Dissecting the Business Tier" book, page 136 in, chapter "Continuous Integration and QA"]
See you at Java EE Workshops at MUC Airport (Effective JavaEE)!
If you are looking for more information: This is what the Continuous Delivery book talks about in great detail and length .
Posted by Eberhard Wolff on May 13, 2013 at 04:19 PM CEST #
thanks! Also it is common sense to keep the build short and "modular", somehow I meet "GOD"-pom.xml over and over again :-)
thanks for your comment!
Posted by Adam Bien on May 14, 2013 at 11:24 AM CEST #
Well, why the need for a "mvn install" if you could just call "mvn test" and "mvn verify"?
Posted by Marcus Kraßmann on May 25, 2013 at 02:00 PM CEST #
In the first build I usually create a WAR which is going to be reused in all downstream jobs.
JavaEE 6+7 apps tend to be rather small (not a lot dependencies are needed), so that does not cause any performance problems.
But: you could package your app later as well.
Btw. even in my case install is too much. "package" would suffice as well.
thanks for you comment!,
Posted by Adam Bien on May 27, 2013 at 02:12 PM CEST #