This repository is copied from https://github.com/hgautam/maven-examples.git for learning Jenkins
Project: java-demo-app
Tasks:
- Clone java-demo-app in your repo
- Import in Jenkins project. Check details on edx platform for the free course: LinuxFoundationX: LFS167x Introduction to Jenkins
- Build and Test as mentioned here: https://courses.edx.org/courses/course-v1:LinuxFoundationX+LFS167x+2T2020/courseware/fa133ee76d9243f2a32acccafb580430/62b3f1946656467abc7d1b6e00fe618e/4?activate_block_id=block-v1%3ALinuxFoundationX%2BLFS167x%2B2T2020%2Btype%40vertical%2Bblock%40c9b9a0706db04a4d94cb647d9354d7b2
Install Java 8 and set JAVA_HOME before starting the project.
Jenkins Plugins installed:
- https://plugins.jenkins.io/build-environment/ to set build environment variables.
- https://plugins.jenkins.io/github-pullrequest/ to get project directly from GitHub and set the credentials while configuring job in jenkins.
- https://plugins.jenkins.io/jacoco/ for code coverage reports.
- https://plugins.jenkins.io/maven-plugin/ for maven integration.
- https://plugins.jenkins.io/warnings-ng/ - visualisation for warnings, compiler errors, etc.
Some known issues and workaround:
- Plugin Manager -> Advanced, change the update site url from https to http
- Manage Jenkins -> Configure System -> Set Global variables like JAVA_HOME and JDK
- Manage Jenkins -> Global Tool Configuration -> Add JDK -> JDK name: Java8 and JAVA_HOME: local path to JDK
- Manage Jenkins -> Global Tool Configuration -> Maven -> name: maven3 and Install from Apache: select the version and select "install automatically"