ci: 使用统一的mvnw

This commit is contained in:
CaptainB 2024-04-19 12:46:20 +08:00
parent 067d1af357
commit c0d9e96e3c
2 changed files with 7 additions and 6 deletions

View File

@ -11,6 +11,7 @@ COPY ${DEPENDENCY}/BOOT-INF/classes /app
# 静态文件
COPY backend/app/src/main/resources/static /app/static
ADD frontend/public /app/static
ENV JAVA_CLASSPATH=/app:/opt/jmeter/lib/ext/*:/app/lib/*

12
Jenkinsfile vendored
View File

@ -46,8 +46,8 @@ pipeline {
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:/opt/apache-maven-3.8.3/bin:$PATH
java -version
mvn deploy -N -Drevision=${REVISION} --settings ./settings.xml
mvn clean deploy -Drevision=${REVISION} -DskipTests -DskipAntRunForJenkins -pl !app --file backend/pom.xml --settings ./settings.xml
./mvnw deploy -N -Drevision=${REVISION} --settings ./settings.xml
./mvnw clean deploy -Drevision=${REVISION} -DskipTests -DskipAntRunForJenkins -pl !app --file backend/pom.xml --settings ./settings.xml
'''
}
}
@ -67,7 +67,7 @@ pipeline {
rm -rf $LOCAL_REPOSITORY/io/metersphere/metersphere-jmeter-assertions/*
rm -rf $LOCAL_REPOSITORY/io/metersphere/metersphere-jmeter-functions/*
mvn clean install -Drevision=${REVISION} -DskipTests --settings ./settings.xml
./mvnw clean install -Drevision=${REVISION} -DskipTests --settings ./settings.xml
mkdir -p backend/app/target/dependency && (cd backend/app/target/dependency && jar -xf ../*.jar);
'''
}
@ -82,7 +82,7 @@ pipeline {
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:/opt/apache-maven-3.8.3/bin:$PATH
LOCAL_REPOSITORY=$(mvn help:evaluate -Dexpression=settings.localRepository --settings ./settings.xml -q -DforceStdout)
LOCAL_REPOSITORY=$(./mvnw help:evaluate -Dexpression=settings.localRepository --settings ./settings.xml -q -DforceStdout)
libraries=('general-xpack-impl')
for library in "${libraries[@]}";
@ -104,7 +104,7 @@ pipeline {
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:/opt/apache-maven-3.8.3/bin:$PATH
java -version
LOCAL_REPOSITORY=$(mvn help:evaluate -Dexpression=settings.localRepository --settings ./settings.xml -q -DforceStdout)
LOCAL_REPOSITORY=$(./mvnw help:evaluate -Dexpression=settings.localRepository --settings ./settings.xml -q -DforceStdout)
# echo $LOCAL_REPOSITORY
libraries=('metersphere-api-test-impl' 'metersphere-ui-test-impl' 'metersphere-load-test-impl' 'general-xpack-impl')
@ -113,7 +113,7 @@ pipeline {
cp -rf $LOCAL_REPOSITORY/io/metersphere/$library/${REVISION}/$library-${REVISION}.jar backend/app/target/dependency/BOOT-INF/lib/
#
rm -rf $LOCAL_REPOSITORY/io/metersphere/$library/${REVISION}/target/lib/*
mvn dependency:copy-dependencies -DincludeScope=runtime --file $LOCAL_REPOSITORY/io/metersphere/$library/${REVISION}/$library-${REVISION}.pom --settings ./settings.xml
./mvnw dependency:copy-dependencies -DincludeScope=runtime --file $LOCAL_REPOSITORY/io/metersphere/$library/${REVISION}/$library-${REVISION}.pom --settings ./settings.xml
cp -rf $LOCAL_REPOSITORY/io/metersphere/$library/${REVISION}/target/lib/* backend/app/target/dependency/BOOT-INF/lib/
done