A build job is a basic execution unit in Jenkins. We can perform many actions using build jobs. We can execute commands, send notifications, configure Continuous Integration, and so on.
Creating a Maven Job for Maven Project
Getting ready
You will need to configure the tools based on the application, such as Maven, Java, Git, and so on.
How to do it...
- Open the Jenkins dashboard.
- Click on New Item.
- Enter an item name.
- Select a template Maven project.
- Click on OK:
- Go to the Source Code Management section and select Git.
- Provide the Repository URL.
- Provide Credentials.
- In the Build section, the Root POM name will be already available.
- Maven has its own set of goals and we can execute any one of those goals based on requirements. These steps are demonstrated in this next screenshot:
- Click on Save.
How it works...
When you go to the Build Job page and click on Build now, it will execute the build based on the configuration.