JENKINS TUTORIAL

Configuring Build System

To configure a build system, there needs to be configure JDK, ANT/MAVEN, SCM configuration details, automating build options email notifications and other important things. Below are the steps to be followed in order to configure the same. In the below case we have considered the project to be a Maven Project.

  • Deploy and start the Jenkins server and from the home page, click on New Item.

    Configuring Build System

  • Then click on OK. Now a new page will be displayed where the details of JDK, ANT/Maven, SCM, automating build options, email notifications can be configured.

    Configuring Build System


Configuring SCM

In order to configure the SCM for the build system, under the "Source Code Management" system, select the required SCM option for your required project and provide the details accordingly.

Configuring SCM

Note : More than one repository URL can be configured in the Jenkins.


Configuring Build Triggers

Jenkins proved multiple options to trigger the builds. Below are the same :

  • Build whenever a SNAPSHOT dependency is built
  • Trigger builds remotely (e.g., from scripts)
  • Build after other projects are built
  • Build periodically (Runs on CRON job)
  • Poll SCM (Runs on CRON job)

User can configure multiple options from the above list. Below screen shot shows how to configure a build based on a CRON job (by selecting the option Build Periodically)

Configuring Build Triggers

The above mentioned CRON expression triggers build on 5 AM and 10 PM every day, every month repeatedly!


Configuring Maven

For any maven project to be built in Jenkins, the entry point is the pom.xml. The easy way to configure a project's build is to point to the pom.xml of the project as shown below :

Configuring Maven

Also, there are many other options which can also be configure here as shown above.


Configuring Maven Build Settings

Jenkins provides the feature to configure the notification service by sending the mails configured for every build runs. It can be configured a shown below :

Configuring Maven Build Settings


Configuring Post build activities

Jenkins also provides feature to configure activities that needs to be executed post build. Below are the options available :

  • Aggregate downstream test results.

    Configuring Post Build activities


  • Archive the artifacts.

    Configuring Post Build activities


  • Build other projects.

    Configuring Post Build activities


  • Deploy artifacts to maven repository.

    Configuring Post Build activities


  • Record fingerprints of files to track usage.

    Configuring Post Build activities