From f5979b61dd5f52f506007d86908baa5f1b7eab97 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期日, 26 十一月 2023 18:08:52 +0800
Subject: [PATCH] 1、优化代码,去除一些类中的main方法,原因是Maven打包不允许有多个main方法; 2、实现pipIrr-mwTest-server模块; 3、重构pom.xml,配置打包策略。

---
 pipIrr-platform/pipIrr-global/pom.xml |  128 +++++++++++++++++++++++++-----------------
 1 files changed, 75 insertions(+), 53 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/pom.xml b/pipIrr-platform/pipIrr-global/pom.xml
index 960b924..1131ab6 100644
--- a/pipIrr-platform/pipIrr-global/pom.xml
+++ b/pipIrr-platform/pipIrr-global/pom.xml
@@ -21,23 +21,19 @@
             <groupId>com.dy</groupId>
             <artifactId>pipIrr-common</artifactId>
             <version>1.0.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <version>3.1.3</version>
+            <scope>provided</scope>
+            <!-- optional=true锛屼笉浼犻�掍緷璧栵紝鍗硃ipIrr-web-base渚濊禆pipIrr-global锛屼絾涓嶄細浼犻�掍緷璧栧埌pipIrr-common -->
+            <optional>true</optional>
             <exclusions>
                 <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-json</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
+                    <!-- 鎺掗櫎鎺塸ipIrr-common鐨勬墍鏈変緷璧栵紝鏈ā鍧楄嚜宸卞畾涔変緷璧� -->
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
+
+
         <!-- 杈撳叆鍙傛暟鎹獙璇� -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -53,47 +49,19 @@
             <artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <version>3.1.3</version>
-            <scope>runtime</scope>
-        </dependency>
         <!-- lombok -->
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <version>1.18.28</version>
         </dependency>
-        <dependency>
-            <groupId>org.aspectj</groupId>
-            <artifactId>aspectjweaver</artifactId>
-            <version>1.9.20</version>
-        </dependency>
-        <!--log4j2鏃ュ織-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-log4j2</artifactId>
-            <version>2.7.9</version>
-        </dependency>
-        <!-- 鐢ㄤ簬杈ㄨlog4j2.yml鏂囦欢 -->
-        <dependency>
-            <groupId>com.fasterxml.jackson.dataformat</groupId>
-            <artifactId>jackson-dataformat-yaml</artifactId>
-            <version>2.15.2</version>
-        </dependency>
-        <!--mybatis-plus-spring-boot-->
+
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
             <version>3.5.3.2</version>
         </dependency>
         <!-- 闃块噷fastjson -->
-        <dependency>
-            <groupId>cglib</groupId>
-            <artifactId>cglib</artifactId>
-            <version>3.3.0</version>
-        </dependency>
         <dependency>
             <groupId>com.alibaba.fastjson2</groupId>
             <artifactId>fastjson2</artifactId>
@@ -120,21 +88,79 @@
         </dependency>
     </dependencies>
 
+
     <build>
         <plugins>
             <plugin>
-                <!-- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 -->
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
+                <!-- 璇ユ彃浠朵笉浼氬皢椤圭洰涓紩鍏ョ殑渚濊禆鎵撹繘鏈�缁堢殑 Jar 鏂囦欢 -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
                 <configuration>
+                    <archive>
+                        <!-- 鐢熸垚鐨刯ar涓紝涓嶈鍖呭惈pom.xml鍜宲om.properties杩欎袱涓枃浠� -->
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                        <!-- 杩欓儴鍒嗗彲鏈夊彲鏃�,鍔犱笂鐨勮瘽鍒欑洿鎺ョ敓鎴愬彲杩愯jar鍖�
+                        <manifest>
+                            <mainClass>com.dy.Main</mainClass>
+                            <useUniqueVersions>false</useUniqueVersions>
+                            <addClasspath>true</addClasspath>
+                            <classpathPrefix>lib/</classpathPrefix>
+                        </manifest>
+                        -->
+                        <!-- manifestEntries鐨勪綔鐢ㄦ槸鎸囧畾鏈湴锛堣嚜宸变笅杞界殑lib涓嬬殑锛塲ar鍖呮坊鍔犲埌MANIFEST.MF鏂囦欢涓幓
+                        <manifestEntries>
+                            <Class-Path>.lib/alipay-sdk.java.jar</Class-Path>
+                        </manifestEntries>
+                        -->
+                    </archive>
+                    <!-- 鎺掗櫎鏌愪釜鏂囦欢
                     <excludes>
-                        <exclude>
-                            <groupId>org.projectlombok</groupId>
-                            <artifactId>lombok</artifactId>
-                        </exclude>
+                        <exclude>com/dy/App.class</exclude>
                     </excludes>
+                    -->
+                    <!-- 鍙墽琛宩ar杩涜鍛藉悕銆傝繖鏍蜂細鎵撳寘鎴愪袱涓猨ar鍖咃紝涓嶄細瀵规櫘閫歫ar閲嶆柊鍛藉悕銆�
+                    <classifier>exec</classifier>
+                     -->
                 </configuration>
             </plugin>
+            <plugin>
+                <!-- 褰撻」鐩腑渚濊禆姣旇緝澶氭椂锛屾垜浠彲浠ュ�熷姪 maven-dependency-plugin 鎻掍欢鑷姩甯垜浠笅杞戒緷璧栫殑 Jar 鏂囦欢锛屾帹鑽愬皢璇ユ彃浠剁粦瀹氬埌package鐢熷懡鍛ㄦ湡涓� -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <!-- 缁戝畾鐢熷懡鍛ㄦ湡 -->
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <!-- 璁剧疆渚濊禆鐨勫瓨鏀捐矾寰� -->
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� -->
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>${encoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <configuration>
+                    <encoding>${encoding}</encoding>
+                </configuration>
+            </plugin>
+
             <plugin>
                 <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 -->
                 <groupId>org.apache.maven.plugins</groupId>
@@ -143,11 +169,7 @@
                     <skipTests>true</skipTests>
                 </configuration>
             </plugin>
-            <plugin>
-                <!-- 寮哄埗璁惧畾 java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� -->
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-            </plugin>
+
         </plugins>
     </build>
 </project>
\ No newline at end of file

--
Gitblit v1.8.0