ci: 本地打包后copy资源文件

This commit is contained in:
CaptainB 2022-04-23 08:57:08 +08:00 committed by 刘瑞斌
parent 421cb05327
commit d069fb4482
2 changed files with 37 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -18,7 +18,7 @@ pipeline {
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:/opt/mvnd/bin:$PATH
java -version
./mvnw clean package --settings ./settings.xml
./mvnw clean package -DskipAntRunForJenkins --settings ./settings.xml
mkdir -p backend/target/dependency && (cd backend/target/dependency; jar -xf ../*.jar)
'''
}

View File

@ -19,6 +19,7 @@
<java.version>11</java.version>
<flyway.version>7.15.0</flyway.version>
<dubbo.version>2.7.15</dubbo.version>
<skipAntRunForJenkins>false</skipAntRunForJenkins>
</properties>
<dependencies>
@ -475,6 +476,41 @@
<version>2.6</version>
</plugin>
<!-- 本地开发需要ci打包时不执行这个插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>main-class-placement</id>
<phase>generate-resources</phase>
<configuration>
<skip>${skipAntRunForJenkins}</skip>
<target>
<copy todir="src/main/resources/static">
<fileset dir="../frontend/dist">
<exclude name="*.html"/>
</fileset>
</copy>
<copy todir="src/main/resources/public">
<fileset dir="../frontend/dist">
<include name="*.html"/>
</fileset>
</copy>
<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>