Creating a Freestyle job for Ant Project
A build job is a basic 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 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 selectGit
. - Provide the
Repository URL
. - Provide
Credentials
, as demonstrated in the next screenshot:

- In the
Build
section, click on theAdd build step
and selectInvoke 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 thebuild.xml
file:

- Click on
Save
.
How it works...
When you go to Build Job page and click on Build now
, it will execute build based on the configuration.