235
235
</repositories >
236
236
237
237
<build >
238
- <resources >
239
- <resource >
240
- <directory >src/main/resources</directory >
241
- <filtering >false</filtering >
242
- </resource >
243
- </resources >
238
+ <plugins >
239
+ <plugin >
240
+ <groupId >org.apache.maven.plugins</groupId >
241
+ <artifactId >maven-dependency-plugin</artifactId >
242
+ <executions >
243
+ <execution >
244
+ <id >copy-dependencies</id >
245
+ <phase >package</phase >
246
+ <goals >
247
+ <goal >copy-dependencies</goal >
248
+ </goals >
249
+ <configuration >
250
+ <outputDirectory >target/lib</outputDirectory >
251
+ <excludeTransitive >false</excludeTransitive >
252
+ <stripVersion >false</stripVersion >
253
+ <includeScope >runtime</includeScope >
254
+ </configuration >
255
+ </execution >
256
+ </executions >
257
+ </plugin >
258
+
259
+ <plugin >
260
+ <groupId >org.apache.maven.plugins</groupId >
261
+ <artifactId >maven-jar-plugin</artifactId >
262
+ <configuration >
263
+ <excludes >
264
+ <exclude >**/*.properties</exclude >
265
+ <exclude >**/*.xml</exclude >
266
+ <exclude >**/*.yml</exclude >
267
+ <exclude >static/**</exclude >
268
+ <exclude >templates/**</exclude >
269
+ </excludes >
270
+ </configuration >
271
+ </plugin >
244
272
245
- <plugins >
246
- <!-- <plugin>
247
- <groupId>org.springframework.boot</groupId>
248
- <artifactId>spring-boot-maven-plugin</artifactId>
249
- </plugin> -->
250
-
251
273
<plugin >
252
274
<groupId >org.springframework.boot</groupId >
253
275
<artifactId >spring-boot-maven-plugin</artifactId >
272
294
</execution >
273
295
</executions >
274
296
</plugin >
275
-
276
- <plugin >
277
- <groupId >org.apache.maven.plugins</groupId >
278
- <artifactId >maven-dependency-plugin</artifactId >
279
- <version >2.10</version >
280
- <executions >
281
- <execution >
282
- <id >copy-dependencies</id >
283
- <phase >package</phase >
284
- <goals >
285
- <goal >copy-dependencies</goal >
286
- </goals >
287
- <configuration >
288
- <outputDirectory >target/lib</outputDirectory >
289
- <excludeTransitive >false</excludeTransitive >
290
- <stripVersion >false</stripVersion >
291
- <includeScope >runtime</includeScope >
292
- </configuration >
293
- </execution >
294
- </executions >
295
- </plugin >
296
- <plugin >
297
- <groupId >org.apache.maven.plugins</groupId >
298
- <artifactId >maven-deploy-plugin</artifactId >
299
- <configuration >
300
- <skip >true</skip >
301
- </configuration >
302
- </plugin >
303
297
304
- <plugin >
305
- <groupId >org.apache.maven.plugins</groupId >
306
- <artifactId >maven-jar-plugin</artifactId >
307
- <configuration >
308
- <archive >
309
- <manifest >
310
- <addDefaultImplementationEntries >true</addDefaultImplementationEntries >
311
- <addDefaultSpecificationEntries >true</addDefaultSpecificationEntries >
312
- </manifest >
313
- <addMavenDescriptor >false</addMavenDescriptor ><!-- 生成的jar中,不要包含pom.xml和pom.properties这两个文件 -->
314
- </archive >
315
- <finalName >${project.artifactId} </finalName >
316
- <excludes >
317
- <exclude >config/**/*</exclude >
318
- <exclude >*.properties</exclude >
319
- <exclude >*.xml</exclude >
320
- <exclude >static/**</exclude >
321
- <exclude >templates/**</exclude >
322
- </excludes >
323
- </configuration >
324
- </plugin >
325
-
326
- <plugin >
298
+ <plugin >
327
299
<groupId >org.apache.maven.plugins</groupId >
328
300
<artifactId >maven-antrun-plugin</artifactId >
329
301
<executions >
335
307
<configuration >
336
308
<target >
337
309
<property name =" dist" >target/distribution</property >
338
- <property name =" res" >target/distribution/resources</property >
339
- <property name =" config" >target/distribution/config</property >
340
310
<property name =" dist-tmp" >target/distribution/tmp</property >
341
311
<property name =" app-name" >${project.artifactId} -${project.version} </property >
342
- <property name =" real-app-name" >${project.artifactId} </property >
343
312
<mkdir dir =" ${dist-tmp}" />
344
- <mkdir dir =" ${res}" />
345
- <mkdir dir =" ${config}" />
346
313
<copy file =" target/${app-name}.jar" tofile =" ${dist-tmp}/${app-name}.jar" />
347
314
<unzip src =" ${dist-tmp}/${app-name}.jar" dest =" ${dist-tmp}" />
348
315
<delete file =" ${dist-tmp}/${app-name}.jar" />
349
- <move file =" target/${app-name}-classes.jar" tofile =" ${dist}/${real-app-name}.jar" />
316
+
317
+ <zip destfile =" ${dist}/${app-name}-pages.jar" >
318
+ <zipfileset dir =" ${dist-tmp}/META-INF" prefix =" META-INF" />
319
+ <!-- <zipfileset dir="target/classes/static" prefix="static" /> -->
320
+ <!-- <zipfileset dir="target/classes/templates" prefix="templates" /> -->
321
+ </zip >
322
+
323
+ <move file =" target/${app-name}-classes.jar" todir =" ${dist}" />
350
324
<move todir =" ${dist}/3rd-lib" >
351
325
<fileset dir =" target/lib" />
352
326
</move >
353
327
354
328
<delete dir =" ${dist-tmp}" />
355
329
356
- <copy todir =" ${res} " >
330
+ <copy todir =" ${dist}/config " >
357
331
<fileset dir =" target/classes" >
358
- <include name =" **/static/**" />
359
- <include name =" **/templates/**" />
332
+ <include name =" **/*.properties" />
333
+ <include name =" **/*.xml" />
334
+ <include name =" **/*.yml" />
360
335
</fileset >
361
336
</copy >
362
- <copy todir =" ${config}" >
337
+
338
+ <copy todir =" ${dist}" >
363
339
<fileset dir =" target/classes" >
364
- <include name =" **/*.properties" />
365
- <include name =" **/*.xml" />
340
+ <include name =" config/**" />
341
+ </fileset >
342
+ <fileset dir =" " >
343
+ <include name =" *.sh" />
366
344
</fileset >
367
345
</copy >
346
+
368
347
</target >
369
348
</configuration >
370
349
</execution >
371
350
</executions >
372
351
</plugin >
373
-
374
- <!-- The configuration of maven-assembly-plugin -->
375
- <plugin >
376
- <groupId >org.apache.maven.plugins</groupId >
377
- <artifactId >maven-assembly-plugin</artifactId >
378
- <executions >
379
- <execution >
380
- <id >make-assembly</id > <!-- 名字任意 -->
381
- <phase >package</phase > <!-- 绑定到package生命周期阶段上 -->
382
- <goals >
383
- <goal >single</goal >
384
- </goals >
385
- <configuration >
386
- <appendAssemblyId >false</appendAssemblyId >
387
- <descriptors >
388
- <descriptor >script/pkg.xml</descriptor >
389
- </descriptors >
390
- <outputDirectory >${project.build.directory} /</outputDirectory >
391
- <finalName >${project.artifactId} </finalName >
392
- </configuration >
393
- </execution >
394
- </executions >
395
- </plugin >
396
- </plugins >
397
- </build >
352
+ </plugins >
353
+ </build >
398
354
</project >
0 commit comments