Jenkins
  • Introduction
  • 1. Jenkins Basics
    • 1.1 Run Jenkins as-is
    • 1.2 Installation of Jenkins
    • 1.3 Installation of jenkins on Tomcat
  • 2. Jenkins Configurations
    • 2.1 Configure Jenkins Slave
    • 2.2 Configure SonarQube with Jenkins
    • 2.3 Configure SilkCentral with Jenkins
    • 2.4 Configure TestNG with Jenkins
  • 3. How to use Jenkins
    • 3.1 Create jobs
    • 3.2 Run jobs
    • 3.3 Run Single Job Parallely in Multiple slaves
  • 4. Jenkins Integrations
    • 4.1 Analysis with SonarQube using Jenkins
    • 4.2 SCTM Result Analysis with Jenkins
    • 4.3 TestNG Result Analysis with Jenkins
  • 5. Jenkins Advanced
    • 5.1Jenkins Challenges
Powered by GitBook
On this page

Was this helpful?

  1. 3. How to use Jenkins

3.1 Create jobs

Previous3. How to use JenkinsNext3.2 Run jobs

Last updated 5 years ago

Was this helpful?

we will create a job in Jenkins which picks up a simple HelloWorld application, builds and runs the java program.

Step 1− Go to the Jenkins dashboard and Click on New Item

Step 2− In the next screen, enter the Item name, in this case we have named it Helloworld. Choose the ‘Freestyle project option’

Step 3− The following screen will come up in which you can specify the details of the job.

Step 4− We need to specify the location of files which need to be built. In this example, we will assume that a local git repository(E:\Program) has been setup which contains a ‘HelloWorld.java’ file. Hence scroll down and click on the Git option and enter the URL of the local git repository.

Note− If you repository if hosted on Github, you can also enter the url of that repository here. In addition to this, you would need to click on the Add button for the credentials to add a user name and password to the github repository so that the code can be picked up from the remote repository.

Step 5− Now go to the Build section and click on Add build step → Execute Windows batch command

Step 6− In the command window, enter the following commands and then click on the Save button.

Javac HelloWorld.java
Java HelloWorld

Step 7− Once saved, you can click on the Build Now option to see if you have successfully defined the job.