Early in my career I took on the role of setting up and operating the build infrastructure of many of the projects I have consulted on. I started in this role before Apache Ant released its 1.0 version. I have struggled with using Cruise Control as my continuous integration server including lava lamps for broken builds. Finally, I have also used and configured just about every code quality tool for Java and built a dashboard to try to combind all the results.
Now after all these years, I think I found the right solutions for Enterprise Java Builds. The solution involves 5 open source projects: Maven, Subversion, Hudson, Nexus, Sonar.
At the core of the solutions is Apache Maven, a build, project, dependency management framework. Maven makes it easy to declaratively describe a project or collection of projects that generate artifacts like binary jars, source jars, doc jars, dependency lists and other artifacts. All these artifacts can be versioned to ensure all developers are using the right artifacts. These artifacts can also be published to a Maven repository making distribution of the artifacts seamless.
In order for developers to collectively own code and integrate often, a source code repository is necessary. Subversion has been a proven enterprise scale repository which integrates well with may tools like Eclipse, Hudson and Maven. But there are many other quality source code repositories that could fit in Subversion's place such as Git. The exact source code repository for this solutions is not as important as having one and having one that integrates well with the choosen tools.
One of the biggest challenges in developing software with a team of people is integrating the software so the practice of continiously integrating has become a staple in many enterprises. After every developer check-in, a continious integration server will check the code out, compile and run all the unit tests. Hudson is possibly the easiest and most powerful continious integration server available for Java. It has a very simple web console that makes creating and configuring build jobs a cinch especially Maven jobs. Just incase that is not enough, it has a very nice plug-in system and community making it very flexible and robust.
After Hudson builds artifacts (jars) that developers need it must publish them to a Maven repository hosted within the enterprise. Nexus is that Maven repository. It enables you to publish both release and snapshot artifacts, provides different views into the respository and includes searching for artifacts even their contents. In addition, it can act as a proxy to external public Maven repository providing traceablity into where artifacts came from as well as improve download performance. Both developers and Hudson can use Nexus to keep their local artifacts up to date providing continious integration for everybody all the time.
Finally, it is valuable to keep metrics about code quality. This can help show if code is improving or declining. This can help easily identify problems, risky areas and bad pratices. Sonar is a server that provides a dashboard into your code quality. It integrates with many common code quality tools like PMD, Checkstyle and FindBugs. It include metrics for code coverage, unit testing and lines of code. The trending capabilities make it easy to identify patterns.