Creating a Maven Job for Maven Project
A build job is a basic execution unit in Jenkins. We can many actions using build jobs. We can execute commands, send notifications, configure Continuous Integration, and so on.
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 selectGit
. - Provide the
Repository URL
. - Provide
Credentials
. - In the
Build
section,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.