Cover by John Ferguson Smart

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Build Steps

Now Jenkins should know where and how often to obtain the project source code. The next thing you need to explain to Jenkins is what it what to do with the source code. In a freestyle build, you do this by defining build steps. Build steps are the basic building blocks for the Jenkins freestyle build process. They are what let you tell Jenkins exactly how you want your project built.

A build job may have one step, or more. It may even occasionally have none. In a freestyle build, you can add as many build steps as you want to the Build section of your project configuration (see Figure 5-26). In a basic Jenkins installation, you will be able to add steps to invoke Maven and Ant, as well as running OS-specific shell or Windows batch commands. And by installing additional plugins, you can also integrate other build tools, such as Groovy, Gradle, Grails, Jython, MSBuild, Phing, Python, Rake, and Ruby, just to name some of the more well-known tools.

In the remainder of this section, we will delve into some of the more common types of build steps.

Maven Build Steps

Jenkins has excellent Maven support, and Maven build steps are easy to configure and very flexible. Just pick “Invoke top-level Maven targets” from the build step lists, pick a version of Maven to run (if you have multiple versions installed), and enter the Maven goals you want to run. Jenkins freestyle build jobs work fine with both Maven 2 and Maven 3.

Just like on the command line, you can specify as many individual ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required