Copy
Wakaleo Consulting - Optimizing your Development Process

Have pity on your system administrator: tips for using Hudson with complex Maven build jobs

This month, we will be taking a look at some of the ways you can make life easier for your system administrator, when you are using Hudson for large Maven projects.

Use the Disk Usage Plugin to keep tabs on disk space

The first thing you need to install to make your System Administrator happy is the Disk Usage Plugin. This plugin lets you keep tabs on how much disk space is being used by your Hudson build jobs, both for the workspace and for the build history. If your Hudson server is running low on disk space, this is the first port of call if you want to find the culprit.

Don't archive your module artifacts

The nextBy default,Maven builds in Hudson archive a copy of the artifacts for each build, even if you don't ask for it. This is even worse for multi-module projects - Hudson will archive the artifacts produced by each module. If your projects are large and your builds are frequent, this is a pure recipe for disaster in terms of disk space. Each build will consume a few hundred MB more disk space, until eventually (by about lunchtime if you have a lot of builds) you will run out of disk space. So, unless you really need this feature (which is generally unlikely), go to your 'Build' section, click on the 'Advanced' button, and tick the "Disable automatic artifact archiving" check box.

Use Sonar, rather than the Maven site generation, for code quality metrics

Maven site generation is an expensive operation. But in many organizations, "mvn site" is used as a short-hand for "generate all my code quality metrics so that I can display it in Hudson". However this is not a very CPU-friendly way of doing things, especially if you have big prohects. So why not be nice to your system admin and your fellow developers, and economize CPU if you don't really need it. If you're only interested in the metrics data (code coverage, code quality, and so forth), then Sonar does a better and more effective job, using all the Maven plugins you are familiar with, and without you having to change your pom.xml files.

Multi-modules and Subversion

This is an example of how arbitrary decisions can sometimes have far-reaching consequences. Consider a simple multi-module project, as shown here:

  + myproject
+ core
+ services
+ web
pom.xml

In this case, the pom.xml file at the root is both the parent and the aggregator. When this goes into Subversion, it might look like this:

  + trunk
+ myproject
+ core
+ services
+ web
pom.xml
+ branches
+ tags

In other organizations, I've seen people use an approach like this:

    + myproject
+ aggregator
+ trunk
+ branches
+ tags
pom.xml
+ core
+ trunk
+ branches
+ tags
+ services
+ trunk
+ branches
+ tags
+ web
+ trunk
+ branches
+ tags

 This second approach is wrong - don't do it. If you do this, you need a separate build job for each module in Hudson, and won't be able to benefit from the neat new multi-module features of the more recent version of Maven. If, on the other hand, you have the trunk at the top-level, you only need one build job for all your modules. (Of course, if you were using something like git or mercurial, this issue wouldn't exist - but that's another story).

Hopefully, by applying these tips, you should be able to keep your disk space and CPU usage on your Hudson build server, and spare your friendly System Administrator a few grey hairs.

Training news

Don't forget to check out the upcoming Testing and TDD for Java Developers course in Wellington, Sydney, Canberra and Melbourne.

Whether you are new to Java testing practices, or already have some experience in the developer testing and TDD/BDD, this material can really help you take . It's a fun, practical workshop packed with labs, where you will using TDD/BDD and a host of testing tools on a real application, to develop real features, rather than the overly-simplified TDD examples you often see.

We will also be running our comprehensive Java Power Tools Bootcamps, in Wellington, Sydney and Canberra, with other sites to be announced soon! This is a full-on course where every developer is guaranteed to learn not just one new technique, but a range of tips, tricks and tools that you can use across the board to speed up your development and set up a kick-ass development infrastructure.

We will also be continuing with the new virtual-classroom Maven training courses in sessions suitable for Australia, New Zealand and Asia. These workshops are an excellent great way to get your team up to speed with Maven. TheJanuary, we will be running these courses in collaboration with Sonatype at a time better suited to Australia, New Zealand, and Asia.

The MVN-101 class is ideal for programmers who work with Maven projects and need to understand how to work with an existing Maven build. It is also appropriate for Maven users who are interested in Maven fundamentals. It comprehensively covers Maven installation and configuration, explains the motivation behind Maven and gives an overview of related development tools.

The next Asia/Pacific session of the MVN-101 course will be running on March 9 and 10, 2010 from 10:00 am to 2:00 pm Tokyo Time. That's 12pm-4pm in Sydney2pm-6pm in Auckland, and 9am-1pm in Singapore.

The MVN-201 course follows on from MVN-101 course and covers more advanced build automation topics. This course is ideal for Development Infrastructure Engineers who are responsible for maintaining enterprise development infrastructure, or anyone wanting a more complete understanding of Maven.

The next MVN-201 course will be the following week on March 16 and 17, 2010 from 10:00 am to 2:00 pm Tokyo Time. Again, that's 12pm-4pm in Sydney2pm-6pm in Auckland, and 9am-1pm in Singapore.

Upcoming Bootcamps
There are still places available on the following Java Power Tools Bootcamps - book early to avoid disappointment!
- Wellington - 22-26 March 2010
Sydney - 12-16 April 2010
Canberra 26-30 April 2010

TDD Workshops

Learn more about the most effective ways to design and test your applications at the new Testing and TDD for Java Developers workshop!
Sydney - 18-19 March
Wellington - 29-30 March
Melbourne - 1-2 April
Canberra - 13-14 May

Online Maven courses
If you can't make it to a face-to-face Maven course, check out the excellent Sonatype virtual classroom Maven training courses

Unsubscribe <<Email Address>> from this list.

Copyright (C) 2010 Wakaleo Consulting All rights reserved.

Forward this email to a friend
Update your profile
Email Marketing Powered by Mailchimp