guang
2023-05-06 56608e48288a97e59fb97340187f57f4a4fcf11e
提交 | 用户 | age
9e1c8d 1 <?xml version="1.0" encoding="UTF-8"?>
G 2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5     <modelVersion>4.0.0</modelVersion>
6
7     <groupId>com.hx.gitee</groupId>
8     <artifactId>phi-other-service</artifactId>
9     <version>1.0-SNAPSHOT</version>
10     <packaging>jar</packaging>
11
12     <parent>
13         <groupId>org.springframework.boot</groupId>
14         <artifactId>spring-boot-starter-parent</artifactId>
15         <version>2.6.2</version>
16     </parent>
17
18     <properties>
19         <mybatis.version>1.1.1</mybatis.version>
20
21         <dist>target/build</dist>
22         <res>target/build/resources</res>
23         <dist-tmp>target/build/tmp</dist-tmp>
24         <app-name>${project.artifactId}-${project.version}</app-name>
25         <real-app-name>${project.artifactId}</real-app-name>
26     </properties>
27
28     <dependencies>
29
30         <dependency>
31             <groupId>org.springframework.boot</groupId>
32             <artifactId>spring-boot-starter</artifactId>
33             <exclusions>
34                 <exclusion>
35                         <groupId>ch.qos.logback</groupId>
36                         <artifactId>logback-classic</artifactId>
37                 </exclusion>
38                 <exclusion>
39                     <groupId>org.springframework.boot</groupId>
40                     <artifactId>spring-boot-starter-logging</artifactId>
41                 </exclusion>
42             </exclusions>
43         </dependency>
44
45         <dependency>
46             <groupId>org.springframework.boot</groupId>
47             <artifactId>spring-boot-starter-log4j2</artifactId>
48         </dependency>
49
50         <dependency>
51             <groupId>com.hx.gitee</groupId>
52             <artifactId>hx-common</artifactId>
53             <version>1.0-SNAPSHOT</version>
54             <exclusions>
55                 <exclusion>
56                     <groupId>javax.servlet</groupId>
57                     <artifactId>servlet-api</artifactId>
58                 </exclusion>
59             </exclusions>
60         </dependency>
61
62         <dependency>
63             <groupId>com.hx.gitee</groupId>
64             <artifactId>hx-auto</artifactId>
65             <version>2.0-SNAPSHOT</version>
66             <scope>compile</scope>
67         </dependency>
68
69         <dependency>
70             <groupId>com.alibaba</groupId>
71             <artifactId>druid-spring-boot-starter</artifactId>
72             <version>1.1.23</version>
73         </dependency>
74
75         <dependency>
76             <groupId>org.springframework.boot</groupId>
77             <artifactId>spring-boot-starter-tomcat</artifactId>
78             <!--<scope>provided</scope>-->
79         </dependency>
80
56608e 81         <!--pageHelper分页-->
G 82         <dependency>
83             <groupId>com.github.pagehelper</groupId>
84             <artifactId>pagehelper-spring-boot-starter</artifactId>
85             <version>1.4.1</version>
86         </dependency>
87
88         <dependency>
89             <groupId>com.github.pagehelper</groupId>
90             <artifactId>pagehelper</artifactId>
91             <version>5.1.11</version>
92         </dependency>
9e1c8d 93     </dependencies>
G 94
95     <profiles>
96         <profile>
97             <id>local</id>
98             <properties>
99                 <environment>local</environment>
100             </properties>
101         </profile>
102         <profile>
103             <id>prod</id>
104             <properties>
105                 <environment>prod</environment>
106             </properties>
107         </profile>
108     </profiles>
109
110     <build>
111         <resources>
112             <resource>
113                 <directory>src/main/java</directory>
114                 <includes>
115                     <include>**/*.xml</include>
116                 </includes>
117             </resource>
118             <resource>
119                 <directory>src/main/resources</directory>
120                 <excludes>
121                     <exclude>application-*.properties</exclude>
122                     <exclude>log4j2-*.xml</exclude>
123                 </excludes>
124             </resource>
125             <resource>
126                 <directory>src/main/resources</directory>
127                 <includes>
128                     <include>application-${environment}.properties</include>
129                     <include>log4j2-local.xml</include>
130                     <include>log4j2-prod.xml</include>
131                     <include>log4j2-${environment}.xml</include>
132                 </includes>
133             </resource>
134         </resources>
135
136         <plugins>
137             <!--**********分离资源文件及依赖包打包配置*************-->
138             <plugin>
139                 <groupId>org.apache.maven.plugins</groupId>
140                 <artifactId>maven-dependency-plugin</artifactId>
141                 <executions>
142                     <execution>
143                         <id>copy-dependencies</id>
144                         <phase>package</phase>
145                         <goals>
146                             <goal>copy-dependencies</goal>
147                         </goals>
148                         <configuration>
149                             <outputDirectory>target/lib</outputDirectory>
150                             <excludeTransitive>false</excludeTransitive>
151                             <stripVersion>false</stripVersion>
152                             <includeScope>runtime</includeScope>
153                         </configuration>
154                     </execution>
155                 </executions>
156             </plugin>
157
158             <plugin>
159                 <groupId>org.apache.maven.plugins</groupId>
160                 <artifactId>maven-jar-plugin</artifactId>
161                 <configuration>
162                     <excludes>
163                         <exclude>**/*.properties</exclude>
164                         <exclude>**/log4j*.xml</exclude>
165                         <exclude>static/**</exclude>
166                         <exclude>templates/**</exclude>
167                     </excludes>
168                 </configuration>
169             </plugin>
170
171             <plugin>
172                 <groupId>org.springframework.boot</groupId>
173                 <artifactId>spring-boot-maven-plugin</artifactId>
174                 <configuration>
6044ac 175                     <mainClass>com.hx.other.service.PhiOtherService</mainClass>
9e1c8d 176                     <layout>ZIP</layout>
G 177                     <includes>
178                         <include>
179                             <groupId>non-exists</groupId>
180                             <artifactId>non-exists</artifactId>
181                         </include>
182                     </includes>
183                 </configuration>
184                 <executions>
185                     <execution>
186                         <goals>
187                             <goal>repackage</goal>
188                         </goals>
189                         <configuration>
190                             <classifier>classes</classifier>
191                             <attach>false</attach>
192                         </configuration>
193                     </execution>
194                 </executions>
195             </plugin>
196             <plugin>
197                 <groupId>org.apache.maven.plugins</groupId>
198                 <artifactId>maven-antrun-plugin</artifactId>
199                 <executions>
200                     <execution>
201                         <phase>package</phase>
202                         <goals>
203                             <goal>run</goal>
204                         </goals>
205                         <configuration>
206                             <target>
207                                 <delete dir="${dist}" />
208                                 <mkdir dir="${dist}" />
209                                 <mkdir dir="${dist-tmp}" />
210                                 <mkdir dir="${res}" />
211                                 <copy file="target/${app-name}.jar" tofile="${dist-tmp}/${app-name}.jar" />
212                                 <unzip src="${dist-tmp}/${app-name}.jar" dest="${dist-tmp}" />
213                                 <delete file="${dist-tmp}/${app-name}.jar" />
214                                 <move file="target/${app-name}-classes.jar" tofile="${dist}/${real-app-name}.jar"/>
215                                 <move todir="${dist}/lib">
216                                     <fileset dir="target/lib" />
217                                 </move>
218
219                                 <delete dir="${dist-tmp}" />
220
221                                 <copy todir="${res}">
222                                     <fileset dir="target/classes">
223                                         <include name="**/static/**" />
224                                         <include name="**/templates/**" />
225                                     </fileset>
226                                 </copy>
227                                 <copy todir="${res}">
228                                     <fileset dir="target/classes">
229                                         <include name="**/*.properties" />
230                                         <include name="**/*.xml" />
231                                         <include name="**/*.yml" />
232                                         <exclude name="**/*Mapper.xml"/>
233                                     </fileset>
234                                 </copy>
235                             </target>
236                         </configuration>
237                     </execution>
238                 </executions>
239             </plugin>
240         </plugins>
241     </build>
242
243 </project>