Configuring Build System in Jenkins
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.
- 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.
Jenkins: 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.
Note : More than one repository URL can be configured in the Jenkins.
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)
The above mentioned CRON expression triggers build on 5 AM and 10 PM every day, every month repeatedly!
Jenkins: 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 :
Also, there are many other options which can also be configure here as shown above.
Jenkins: 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 :
Jenkins: 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.
- Archive the artifacts.
- Build other projects.
- Deploy artifacts to maven repository.
- Record fingerprints of files to track usage.