Commit da4ac962d05194d59bb93684b7aa049b70053ee4

Authored by 648540858
1 parent d1624e2d

优化打包过程,配置自动放到jar包旁边并移除jar内部配置文件

Showing 1 changed file with 38 additions and 0 deletions
@@ -382,6 +382,44 @@ @@ -382,6 +382,44 @@
382 <skipTests>true</skipTests> 382 <skipTests>true</skipTests>
383 </configuration> 383 </configuration>
384 </plugin> 384 </plugin>
  385 +
  386 + <plugin>
  387 + <groupId>org.apache.maven.plugins</groupId>
  388 + <artifactId>maven-jar-plugin</artifactId>
  389 + <version>3.3.0</version>
  390 + <configuration>
  391 + <excludes>
  392 + <exclude>**/all-application.yml</exclude>
  393 + <exclude>**/application.yml</exclude>
  394 + <exclude>**/application-*.yml</exclude>
  395 + <exclude>**/local.jks</exclude>
  396 + </excludes>
  397 + </configuration>
  398 + </plugin>
  399 + <plugin>
  400 + <artifactId>maven-resources-plugin</artifactId>
  401 + <executions>
  402 + <execution> <!-- 复制配置文件 -->
  403 + <id>copy-resources</id>
  404 + <phase>package</phase>
  405 + <goals>
  406 + <goal>copy-resources</goal>
  407 + </goals>
  408 + <configuration>
  409 + <resources>
  410 + <resource>
  411 + <directory>src/main/resources</directory>
  412 + <includes>
  413 + <include>application.yml</include>
  414 + <include>application-*.yml</include>
  415 + </includes>
  416 + </resource>
  417 + </resources>
  418 + <outputDirectory>${project.build.directory}</outputDirectory>
  419 + </configuration>
  420 + </execution>
  421 + </executions>
  422 + </plugin>
385 </plugins> 423 </plugins>
386 <resources> 424 <resources>
387 <resource> 425 <resource>