Creating and Building Jobs in Jenkins

Here I will show you an example on creating and building jobs in Jenkins. We know that Jenkins is a build tool that helps us to automate building, releasing and deploying of the application to appropriate environment. But before we start building application, we need to create a job for that application. Then only we will be able to run build repeatedly as and when required by just clicking on the job name. Here are few other tutorials and one of them you have to go through before you read this tutorial:

Prerequisites

Already have sample java project in your Git repository (either in local or remote repository)

Instructions for creating and building jobs in Jenkins

Step 1. Login to your Jenkins using credentials

Step 2. Either create a new job by clicking on “create new jobs” link on the home page or “New Item” on the left-hand side at the very begining

Step 3. Enter the name of the job and select an option from the list below. Here I have selected the Freestyle.

Step 4. Now you will see few tabs appear as shown below

Step 5. Now for source code management you can choose None, Git or Subversion. I have selected here Git. Put the repository location where your source code is available. Here I have the Git project folder hello that contains only one java file called HelloWorld.java with below content