build: 使用jdk11运行

This commit is contained in:
CaptainB 2022-03-17 19:40:17 +08:00
parent a959e16e22
commit 9141cb4866
1 changed files with 8 additions and 4 deletions

12
Jenkinsfile vendored
View File

@ -13,10 +13,14 @@ pipeline {
stage('Build/Test') {
steps {
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
sh 'export JAVA_HOME=/opt/jdk-11;export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH;export PATH=$JAVA_HOME/bin:$PATH'
sh 'java -version'
sh "./mvnw clean package --settings ./settings.xml"
sh "mkdir -p backend/target/dependency && (cd backend/target/dependency; jar -xf ../*.jar)"
sh '''
export JAVA_HOME=/opt/jdk-11
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
java -version
./mvnw clean package --settings ./settings.xml
mkdir -p backend/target/dependency && (cd backend/target/dependency; jar -xf ../*.jar)
'''
}
}
}