Install Jenkins native on Raspberry Pi

# Basic installation of Jenkins latest LTS version
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian/jenkins.io-2023.key
echo “deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]” https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install fontconfig openjdk-17-jre
sudo apt-get install jenkins

Now the Jenkins UI is available on port 8080
Answer some extra installation questions and wait for the installation to complete.

# Enable Maven in Jenkins
Goto Jenkins UI
Go to “Manage Jenkins” -> “Plugins” -> “Install Plugins” -> Select “Maven integration plugin”
Go to “Manage Jenkins” -> “Tool” -> “Maven installations”
Press “Add Maven”
Select “Install automatically”
Select “Version”
Press “Save”

# Create Project (Public GitHub REPO)
Goto Jenkins UI
Select “New Item”
Enter Project Name
Select “Maven Project”
Press “Ok”
Select “Source Code Management”
Select “GIT”
Enter by Repository URL the GIT URL
Press “Save”
Press “Build”
Now project will be build and all unit tests are automatic run.

# Create Project (Private GitHub REPO)
Goto GitHub UI
Select “Setting” -> “Developer Settings”
Select “Personal access token” -> “Tokens (classic)”
Press “Generate new Token (Classic)”
Enter Name
Select “No expiration”
Select “all scopes”
Press “Generate Token”
Copy token key to clipboard

Goto Jenkins UI
Select “New Item”
Enter Project Name
Select “Maven Project”
Press “Ok”
Select “Source Code Management”
Select “GIT”
Enter by Repository URL the GIT URL
Select “Credentials” -> “Add” -> “Jenkins”
Select “Username with password”
Enter “Username” -> Its your Github username
Enter “Password” -> Copy token key from clipboard
Select “Threat username as secret”
Press “Save”
Press “Build”
Now project will be build and all unit tests are automatic run.