Chapter 5. Build processes

 

This chapter covers

  • Adding Groovy to Ant builds
  • Using Maven with Groovy
  • Groovy Grapes and @Grab
  • The future: Gradle

Building source code is almost always a pain point in development organizations. An ideal build process is automated end-to-end, including compilation, running tests, generating reports, and producing any required artifacts. The process needs to be fast enough that it can be done frequently, especially given modern agile approaches, and yet flexible enough to adapt to the exigencies of individual teams.

In the Java world two primary approaches to automated builds have emerged over time. Both are open source projects from Apache. The first is Ant (http://ant.apache.org), which uses a library of tasks configured in XML backed by Java classes. The other is Maven (http://maven.apache.org), which offers a rich array of options and promises to make the entire process simple, but uses a highly opinionated API that requires a degree of mastery to use effectively.

To start I want to address the goals of any build process, and then see how the various tools attempt to meet them.

5.1. The build challenge

A software build combines several features that individually seem like they ought to be easy but in practice become complicated. To build your code you must

5.2. The Java approach, part 1: Ant

 
 

5.3. Making Ant Groovy

 
 

5.4. The Java approach, part 2: Maven

 
 
 

5.5. Grapes and @Grab

 
 
 

5.6. The Gradle build system

 
 
 
 

5.7. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage