Hello, I faced an error while making a lab of Build and Test via pipeline
So i have my own lab, Jenkins Running on Centos 8 and the Java Version is like below
[root@jenkins-master ~]# java -version
openjdk version “17.0.1” 2021-10-19 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing)
then while i creating and finishing my pipeline like below
pipeline {
agent any
tools {
// Install the Maven version configured as "M399" and add it to the path.
maven "M399"
}
stages {
stage(‘Echo Version’){
steps{
sh ‘echo print Maven Version’
sh ‘mvn -version’
}
}
stage(‘Build JAR’){
steps{
//Get code from github repo
git branch: ‘main’, url: ‘GitHub - sidd-harth/jenkins-hello-world’
//BUild JAR File
sh “mvn clean package -DskipTests=true”
}
}
stage (‘Unit Test Cases’){
steps {
mvn test
}
}
stage (‘Deploy/Run’){
steps{
sh “java -jar target/hello-demo-*.jar”
}
}
stage (‘Integration Testing (Return 200 OK response)’){
steps {
sh "curl -s http://localhost:6767/hello"
}
}
}
}
it failed in step of //BUild JAR File
and facing the below error
and if i navigate to pom.xml
we found that
<java.version>17</java.version>
So need to know from where i can start troubleshooting