Follow the below steps to create your first job in Jenkins for a Java Application.
1. Clone this sample GitHub repository in your local (https://github.com/patebija/HelloWorldExample.git).
2. Go to Jenkins Dashboard and click on New Item.
3. Enter any item name “SimpleJavaApplication”.
4. Select Maven project and click on OK button.
5. In General section, enter some text in the Description “A simple java application”.
6. In Source Code Management, select Git and enter the GitHub repository url.
7. In Build section, enter Root POM as “pom.xml” and Goals and options as “clean install”.
8. In Post-build Actions section, click on Add post-build action and select “Archive the artifacts”.
9. In Files to archive field, enter the path file path as “target/*.jar”.
10. Click on Save to create your new job.
11. Go back to Jenkins Dashboard and click on “Schedule a build for SimpleJavaApplication”.
12. After the build is successful, you will be able to see your .jar file under Last Successful Artifacts and the Workspace folder which contains all the project folders.