mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-13 16:57:08 +08:00
build: 重构打包配置以同时支持胖包和瘦包模式
This commit is contained in:
@@ -81,7 +81,54 @@
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.parent.name}</finalName>
|
||||
<plugins>
|
||||
<!-- Maven 打包插件 -->
|
||||
<!-- Spring Boot 可执行 JAR 打包插件 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
<skip>${skip.boot.repackage}</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<!-- 默认 Spring Boot 胖包 模式 -->
|
||||
<profile>
|
||||
<id>fat_jar</id>
|
||||
<properties>
|
||||
<skip.boot.repackage>false</skip.boot.repackage>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<!-- 瘦包 模式(可执行 JAR + lib + config) -->
|
||||
<profile>
|
||||
<id>slim_jar</id>
|
||||
<!--默认-->
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<skip.boot.repackage>true</skip.boot.repackage>
|
||||
|
||||
<!-- 路径变量 -->
|
||||
<lib-path>lib/</lib-path>
|
||||
<config-path>config/</config-path>
|
||||
<bin-path>bin/</bin-path>
|
||||
<!-- 启动类 -->
|
||||
<main-class>top.continew.admin.ContiNewAdminApplication</main-class>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 分离打包 JAR(不包含依赖) -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
@@ -110,6 +157,7 @@
|
||||
<outputDirectory>${project.build.directory}/app/${bin-path}</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- 拷贝依赖 jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -127,6 +175,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- 拷贝配置文件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -157,6 +206,9 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
Reference in New Issue
Block a user