|
|
@@ -299,6 +299,56 @@
|
|
|
<workingDirectory>${project.parent.basedir}</workingDirectory>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-jar-plugin</artifactId>
|
|
|
+ <executions>
|
|
|
+ <!--
|
|
|
+ 肥瘦包:
|
|
|
+ - 主构件 ai-server-{version}.jar 仍由 spring-boot:repackage 产出(含依赖,java -jar 直接运行);
|
|
|
+ - 本 execution 额外挂一个 ai-server-{version}-thin.jar(只含项目 classes/resources),
|
|
|
+ manifest 写入 Main-Class 与 Class-Path: lib/,与 target/lib 同目录时 java -jar 可直接运行。
|
|
|
+ -->
|
|
|
+ <execution>
|
|
|
+ <id>thin-jar</id>
|
|
|
+ <phase>package</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>jar</goal>
|
|
|
+ </goals>
|
|
|
+ <configuration>
|
|
|
+ <classifier>thin</classifier>
|
|
|
+ <archive>
|
|
|
+ <manifest>
|
|
|
+ <addClasspath>true</addClasspath>
|
|
|
+ <classpathPrefix>lib/</classpathPrefix>
|
|
|
+ <mainClass>com.zsjz.ai.App</mainClass>
|
|
|
+ </manifest>
|
|
|
+ </archive>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-dependency-plugin</artifactId>
|
|
|
+ <executions>
|
|
|
+ <!-- 瘦包配套的依赖目录:target/lib,部署时与 -thin.jar 放在同一目录 -->
|
|
|
+ <execution>
|
|
|
+ <id>copy-libs</id>
|
|
|
+ <phase>package</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>copy-dependencies</goal>
|
|
|
+ </goals>
|
|
|
+ <configuration>
|
|
|
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
|
|
|
+ <!-- runtime = compile + runtime,排除 test/provided/optional -->
|
|
|
+ <includeScope>runtime</includeScope>
|
|
|
+ <overWriteReleases>false</overWriteReleases>
|
|
|
+ <overWriteSnapshots>false</overWriteSnapshots>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-compiler-plugin</artifactId>
|