|
|
@@ -222,6 +222,52 @@
|
|
|
|
|
|
<build>
|
|
|
<plugins>
|
|
|
+ <!-- 使用 maven-shade-plugin 打包所有依赖 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-shade-plugin</artifactId>
|
|
|
+ <version>3.5.1</version>
|
|
|
+ <executions>
|
|
|
+ <execution>
|
|
|
+ <phase>package</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>shade</goal>
|
|
|
+ </goals>
|
|
|
+ <configuration>
|
|
|
+ <!-- 创建可执行的 JAR -->
|
|
|
+ <transformers>
|
|
|
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
|
|
+ <mainClass>com.njuzr.eaibackend.EaiBackendApplication</mainClass>
|
|
|
+ </transformer>
|
|
|
+ <!-- 合并 META-INF/spring.factories 文件 -->
|
|
|
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
|
|
+ <resource>META-INF/spring.factories</resource>
|
|
|
+ </transformer>
|
|
|
+ <!-- 合并 META-INF/spring.components 文件 -->
|
|
|
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
|
|
+ <resource>META-INF/spring.components</resource>
|
|
|
+ </transformer>
|
|
|
+ </transformers>
|
|
|
+ <!-- 排除签名文件,避免冲突 -->
|
|
|
+ <filters>
|
|
|
+ <filter>
|
|
|
+ <artifact>*:*</artifact>
|
|
|
+ <excludes>
|
|
|
+ <exclude>META-INF/*.SF</exclude>
|
|
|
+ <exclude>META-INF/*.DSA</exclude>
|
|
|
+ <exclude>META-INF/*.RSA</exclude>
|
|
|
+ </excludes>
|
|
|
+ </filter>
|
|
|
+ </filters>
|
|
|
+ <!-- 生成依赖简化后的文件 -->
|
|
|
+ <createDependencyReducedPom>false</createDependencyReducedPom>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- 跳过 spring-boot-maven-plugin,避免冲突 -->
|
|
|
+ <!--
|
|
|
<plugin>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
@@ -234,6 +280,8 @@
|
|
|
</excludes>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
+ -->
|
|
|
+
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-surefire-plugin</artifactId>
|