jenkins the definitive guide

(Jeff_L) #1

By default, Jenkins proposes to download the JDK from the Oracle website. If your Jenkins installation
is behind a proxy server, you may need to configure your proxy settings to ensure that Jenkins can access
the external download sites (see Section 4.9, “Configuring a Proxy”). Another option is to provide a
URL pointing to your own internal copy of the JDK binaries (either in the form of a ZIP or a GZip-
compressed TAR file), stored on a local server within your organization. This lets you provide standard
installations on a local server and makes for faster automatic installations. When you use this option,
Jenkins also lets you specify a label, which will restrict the use of this installation to the build notes with
this label. This is a useful technique if you need to install a specific version of a tool on certain build
machines. The same approach can also be used for other build tools (such as Maven and Ant).


Figure 4.6. Installing a JDK automatically


The automatic installer will not work in all environments (if it can’t find or identify your operating
system to its satisfaction, for example, the installation will fail), but it is nevertheless a useful and
convenient way to set up new build servers or distributed build agents in a consistent manner.


4.6. Configuring Your Build Tools


Build tools are the bread-and-butter of any build server, and Jenkins is no exception. Out of the box,
Jenkins supports three principal build tools: Ant, Maven, and the basic shell-script (or Batch script in
Windows). Using Jenkins plugins, you can also add support for other build tools and other languages,
such as Gant, Grails, MSBuild, and many more.


4.6.1. Maven


Maven is a high-level build scripting framework for Java that uses notions such as a standard directory
structure and standard life cycles, Convention over Configuration, and Declarative Dependency
Management to simplify a lot of the low-level scripting that you find in a typical Ant build script. In
Maven, your project uses a standard, well-defined build life cycle—compile, test, package, deploy, and

Free download pdf