In this Jenkins tutorial we will learn how to install Jenkis Continuous Integration System and configure it to run a basic Maven 3 project.
Jenkins, formerly known as Hudson, is a quick to use continuous integration system, which can be used to automate the built of your projects at a scheduled time or when a trigger is raised (e.g. a CVS commit) or simply when the user requests it. The automated, continuous build can help a lot in increasing the productivity and reducing conflicts.
Besides this, Jenkis can also monitor the execution of external jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. Let's get started by downloading Jenkis Generic Java Package Web archive from http://jenkins-ci.org/
You have two options to install the Jenkins Web application Archive:
1) Run it as a Java application by executing:
$ java -jar jenkins.war
The above command will start a Jetty Web Server where Jenkins is deployed. The default port of the service is 8080 (This can be changed passing the --httpPort=$HTTP_PORT parameter to the java interpeter):
2) Deploy the war archive into your WildFly/Tomcat deployments folder with no other configuration required.
For example, if you were to deploy in on WildFly:
$ cp jenkins.war $JBOSS_HOME/standalone/deployments
The installation was a breeze so we can get into the configuration of Jenkins.
The first thing needed to get started is unlocking Jenkins. This requires entering an initial administrator password which is printed on your filesystem and on the application server console too (if you are installing jenkins on the application server):
Type the temporary administrator password.
Jenkins configuration is stored, by default, in your $HOME/.jenkins folder. If you have formerly installed jenkins on your machine you should remove the .jenkins folder so that you can re-install again it.
Next, you will be requested to register for an administration user so fill up the following UI:
What is Jenkins default user? Out of the box there is no pre-defined user for jenkins. You can however (not recommended!) disable the need for logging in by setting <useSecurity>false</useSecurity> in $HOME/.jenkins/config.xml
Basic Jenkins configuration
From the Home page, click on the "Manage Jenkins" link:
From there, you can access to a wide set of options which will let you configure (and update too using plugins) your Jenkins configurations. As first step, we will need to enter the location for our JDK installation and our Maven home. Click on the Global Tool Configuration link:
You will be taken to the Configuration panel. From there, you can configure the JDK Home and the Maven Home to be used.
In order to configure the JDK and Maven click on their buttons. If you have already available an installation of it simply uncheck the "Install automatically" option and enter your JAVA_HOME and Maven Home:
- Next >>