build: 使用mvnd加速构建过程
This commit is contained in:
parent
095d901d52
commit
86c7eac9ae
12
Dockerfile
12
Dockerfile
|
@ -9,6 +9,18 @@ COPY ${DEPENDENCY}/BOOT-INF/lib /opt/lib
|
|||
COPY ${DEPENDENCY}/META-INF /opt/META-INF
|
||||
COPY ${DEPENDENCY}/BOOT-INF/classes /opt
|
||||
|
||||
# html 文件
|
||||
COPY frontend/dist/*.html /opt/public/
|
||||
|
||||
# 静态文件
|
||||
COPY frontend/dist/favicon.ico /opt/static/favicon.ico
|
||||
COPY frontend/dist/fonts /opt/static/fonts
|
||||
COPY frontend/dist/img /opt/static/img
|
||||
COPY frontend/dist/js /opt/static/js
|
||||
COPY frontend/dist/css /opt/static/css
|
||||
COPY frontend/dist/*.worker.js /opt/static/
|
||||
COPY frontend/src/assets/theme/index.css /opt/static/css/index.css
|
||||
|
||||
ENV JAVA_CLASSPATH=/opt:/opt/lib/ms-jmeter-core.jar:/opt/lib/*
|
||||
ENV JAVA_MAIN_CLASS=io.metersphere.Application
|
||||
ENV AB_OFF=true
|
||||
|
|
|
@ -16,9 +16,9 @@ pipeline {
|
|||
sh '''
|
||||
export JAVA_HOME=/opt/jdk-11
|
||||
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
export PATH=$JAVA_HOME/bin:/opt/mvnd/bin:$PATH
|
||||
java -version
|
||||
./mvnw clean package --settings ./settings.xml
|
||||
mvnd clean package --settings ./settings.xml
|
||||
mkdir -p backend/target/dependency && (cd backend/target/dependency; jar -xf ../*.jar)
|
||||
'''
|
||||
}
|
||||
|
|
|
@ -475,38 +475,6 @@
|
|||
<version>2.6</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>main-class-placement</id>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<move todir="src/main/resources/static">
|
||||
<fileset dir="../frontend/dist">
|
||||
<exclude name="*.html"/>
|
||||
</fileset>
|
||||
</move>
|
||||
<move todir="src/main/resources/public">
|
||||
<fileset dir="../frontend/dist">
|
||||
<include name="*.html"/>
|
||||
</fileset>
|
||||
</move>
|
||||
<copy todir="src/main/resources/static/css">
|
||||
<fileset dir="../frontend/src/assets/theme">
|
||||
<include name="index.css"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
|
|
|
@ -65,6 +65,20 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>dist</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
<followSymlinks>false</followSymlinks>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue