This repository contains a sample Java Maven application used to demonstrate Jenkins CI/CD concepts, including pipeline development, shared libraries, job automation, and deployment workflows.
To configure Jenkins to run a pipeline directly from a GitHub repository using a Jenkinsfile, follow these steps.
- Jenkins installed and running
- Git plugin installed
- Pipeline plugin installed
- Access to the GitHub repository
- A Jenkinsfile stored in the repository
- Open Jenkins.
- Click New Item.
- Enter a job name.
- Select Pipeline.
- Click OK.
In the job configuration: General (Optional)
- Check GitHub project
- Enter your repository URL, example: https://github.com/username/java-maven-app
Scroll to the Pipeline section. Definition Select: Pipeline script from SCM
SCM Select: Git
Repository URL, example: https://github.com/FPurichaya/java-maven-app.git
For private repositories:
- Click Add Credentials
- Add:
- GitHub Personal Access Token
- Username/password
- SSH key
Branch Specifier Specify the branch to build. Examples: */feature/ansible
Script Path Specify the location of the Jenkinsfile.
Click: Save Then: Build Now