杜洪波
2025-05-13 0b9df3115ad57a827581c6ec81f9b411cd19218b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.lx</groupId>
        <artifactId>product-server</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>
    <artifactId>product-server-web</artifactId>
    <packaging>jar</packaging>
    <name>product-server-web</name>
    <description>product-server-web</description>
    <profiles>
        <profile>
            <id>dev</id>
            <properties>
                <profileActive>dev</profileActive>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
 
        </profile>
 
        <profile>
            <id>test</id>
            <properties>
                <profileActive>test</profileActive>
            </properties>
        </profile>
 
        <profile>
            <id>prod</id>
            <properties>
                <profileActive>prod</profileActive>
            </properties>
        </profile>
 
    </profiles>
    <dependencies>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-common</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-print</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-util</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-admin</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-quartz</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-org-admin</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
 
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-administration</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-mq</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-file</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
 
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-email</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <!-- releases -->
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-core</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.sendgrid</groupId>
            <artifactId>sendgrid-java</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-test</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.1</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-report</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-data-export-import</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <!--    <dependency>-->
        <!--        <groupId>com.lx</groupId>-->
        <!--        <artifactId>product-server-mobile-core</artifactId>-->
        <!--        <version>1.0.0-SNAPSHOT</version>-->
        <!--    </dependency>-->
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-system</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-tool-flow</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-tool-form</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-tool-form-tree</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-tool-mvc</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-announcement</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-tool-table</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-data-sync</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-badge</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-email</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-text-message</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-auth</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-message</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-xining</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <!--<dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-code-auto-generate</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>-->
        <!--        <dependency>-->
        <!--            <groupId>com.lx</groupId>-->
        <!--            <artifactId>product-project-server-contract</artifactId>-->
        <!--            <version>1.0.0-SNAPSHOT</version>-->
        <!--        </dependency>-->
        <dependency>
            <groupId>org.spring</groupId>
            <artifactId>spring-server-master</artifactId>
            <version>1.2.6.0</version>
        </dependency>
 
        <!--项目管理模块-->
        <!--    <dependency>-->
        <!--        <groupId>com.lx</groupId>-->
        <!--        <artifactId>product-project-server-base</artifactId>-->
        <!--        <version>1.0.0-SNAPSHOT</version>-->
        <!--    </dependency>-->
        <!--    <dependency>-->
        <!--        <groupId>com.lx</groupId>-->
        <!--        <artifactId>product-project-server-contract</artifactId>-->
        <!--        <version>1.0.0-SNAPSHOT</version>-->
        <!--    </dependency>-->
        <dependency>
            <groupId>com.lx</groupId>
            <artifactId>product-server-customer</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- 打JAR包 -->
 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <!-- 不打包资源文件(配置文件和依赖包分开) -->
                    <excludes>
                        <exclude>*.properties</exclude>
                        <exclude>*.xml</exclude>
                    </excludes>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <!-- MANIFEST.MF 中 Class-Path 加入前缀 -->
                            <classpathPrefix>lib/</classpathPrefix>
                            <!-- jar包不包含唯一版本标识 -->
                            <useUniqueVersions>true</useUniqueVersions>
                            <!--指定入口类 -->
                            <mainClass>com.product.Application</mainClass>
                        </manifest>
                        <manifestEntries>
                            <!--MANIFEST.MF 中 Class-Path 加入资源文件目录 -->
                            <Class-Path>./resources/</Class-Path>
                        </manifestEntries>
 
                    </archive>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
            </plugin>
 
            <!-- 该插件的作用是用于复制依赖的jar包到指定的文件夹里 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </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>*.properties</include>
                                        <include>*.yml</include>
                                        <include>*.xml</include>
                                        <include>*.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
 
            <!-- SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖 -->
                    <includes>
                        <include>
                            <groupId>null</groupId>
                            <artifactId>null</artifactId>
                        </include>
                    </includes>
                    <includeSystemScope>true</includeSystemScope>
                    <layout>ZIP</layout>
                    <!-- 使用外部配置文件,jar包里没有资源文件 -->
                    <addResources>true</addResources>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- 执行bat 前端编译 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target description="run the bat">
                                <echo>开始运行packed.bat命令行</echo>
                                <exec dir="D:/product/lxworkspaces/product-web" executable="cmd.exe">
                                    <arg line="packed.bat"></arg>
                                </exec>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
 
            <!-- 拷贝文件 -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <copy todir="D:/product/lxworkspaces/product-server-install/resources/product-server/lib">
                                    <fileset dir="${project.build.directory}/lib">
                                        <include name="*.jar" />
                                        <exclude name="product-server-core-1.0.0-SNAPSHOT.jar"/>
                                    </fileset>
                                </copy>
                                <copy todir="D:/product/lxworkspaces/product-server-install/resources/product-server/resources">
                                    <fileset dir="${project.build.directory}/resources">
                                        <include name="application-prod.properties" />
                                        <include name="cache-prod.properties" />
                                        <include name="*.txt" />
                                        <include name="*.xml" />
                                    </fileset>
                                </copy>
                                <copy todir="D:/product/lxworkspaces/product-server-install/resources/product-server/web">
                                    <fileset dir="D:/product/lxworkspaces/product-web/dist">
                                        <include name="*.*" />
                                    </fileset>
                                </copy>
                                <copy file="${project.build.directory}/product-server-web-1.0.0-SNAPSHOT.jar" tofile="D:/product/lxworkspaces/product-server-install/resources/product-server/product-server-web-1.0.0-SNAPSHOT.jar" overwrite="true"/>
                            </tasks>
 
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
 
        </plugins>
    </build>
</project>