Create Sample Build Job
- Fork Sample Maven Application Project hosted on git.
- Create a new Maven job “SampleJob” from Jenkins -> New Item for Build and deploy.
- Go to Jenkins -> SampleJob -> Configure.
- Select JDK version.
- Under Source Code Management, select Git. Provide Git Repository URL for application project and select Branch.
- Under Build Triggers section, check “POLL SCM” and provide “* * * * * “ so that the Jenkins polls the Git every minute.
- Under Build , enter the ROOT POM (pom.xml file) which is present in the application project.
- Provide Goals and options as “clean install” and under Post Steps, check “Run only if build succeeds”.
- Under Post-build Actions, select “Deploy Artifacts to Artifactory” and provide the Target releases repository and Target snapshot repository.
- Click on Apply and Save.