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 Freestyle job for Ant Project
Getting ready
You will need to configure tools based on the application, such as Ant, Gradle, Java, Git, and so on.
How to do it...
- Open the Jenkins dashboard.
- Click on New Item.
- Enter an item name.
- Select a template Freestyle project.
- Click on OK:
- Go to the Source Code Management section and select Git.
- Provide the Repository URL.
- Provide Credentials, as demonstrated in the next screenshot:
- In the Build section, click on the Add build step and select Invoke Ant.
- Select the Ant name based on our Global Tool Configuration.
- Provide Targets. In Ant, we can give a target based on the targets defined in the build.xml file:
- 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.