From da4ac962d05194d59bb93684b7aa049b70053ee4 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 13 三月 2024 16:37:45 +0800
Subject: [PATCH] 优化打包过程,配置自动放到jar包旁边并移除jar内部配置文件

---
 pom.xml |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/pom.xml b/pom.xml
index b316e98..7ec73b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -382,6 +382,44 @@
                     <skipTests>true</skipTests>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.3.0</version>
+                <configuration>
+                    <excludes>
+                        <exclude>**/all-application.yml</exclude>
+                        <exclude>**/application.yml</exclude>
+                        <exclude>**/application-*.yml</exclude>
+                        <exclude>**/local.jks</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution> <!-- 澶嶅埗閰嶇疆鏂囦欢 -->
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources</directory>
+                                    <includes>
+                                        <include>application.yml</include>
+                                        <include>application-*.yml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
         <resources>
             <resource>

--
Gitblit v1.8.0