|
|
@@ -57,6 +57,91 @@
|
|
|
<groupId>com.mysql</groupId>
|
|
|
<artifactId>mysql-connector-j</artifactId>
|
|
|
</dependency>
|
|
|
-
|
|
|
</dependencies>
|
|
|
+
|
|
|
+ <build>
|
|
|
+ <plugins>
|
|
|
+ <!--该插件的作用是打包spring-boot的jar包-->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
+ <configuration>
|
|
|
+ <!--不排除的话,systemScope的依赖包会自动被此插件打包进xxx.jar\BOOT-INF\lib,和外部依赖产生冲突 -->
|
|
|
+ <includeSystemScope>false</includeSystemScope>
|
|
|
+ <skip>false</skip>
|
|
|
+ <!--分离Jar包-->
|
|
|
+ <layout>ZIP</layout>
|
|
|
+ <includes>
|
|
|
+ <include>
|
|
|
+ <groupId>nothing</groupId>
|
|
|
+ <artifactId>nothing</artifactId>
|
|
|
+ </include>
|
|
|
+ </includes>
|
|
|
+ </configuration>
|
|
|
+ <executions>
|
|
|
+ <execution>
|
|
|
+ <goals>
|
|
|
+ <goal>repackage</goal>
|
|
|
+ </goals>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </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>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-resources-plugin</artifactId>
|
|
|
+ <executions>
|
|
|
+ <!-- 复制配置文件 -->
|
|
|
+ <execution>
|
|
|
+ <id>copy-resources</id>
|
|
|
+ <phase>package</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>copy-resources</goal>
|
|
|
+ </goals>
|
|
|
+ <configuration>
|
|
|
+ <resources>
|
|
|
+ <!--复制资源文件到外部,注意这里先不做filtering处理,防止某些静态文件损坏-->
|
|
|
+ <resource>
|
|
|
+ <filtering>false</filtering>
|
|
|
+ <directory>src/main/resources</directory>
|
|
|
+ <includes>
|
|
|
+ <include>**/*</include>
|
|
|
+ </includes>
|
|
|
+ </resource>
|
|
|
+ <!--仅针对配置文件filtering处理(占位符@@等)-->
|
|
|
+ <resource>
|
|
|
+ <directory>src/main/resources</directory>
|
|
|
+ <filtering>true</filtering>
|
|
|
+ <includes>
|
|
|
+ <include>*.xml</include>
|
|
|
+ <include>*.yml</include>
|
|
|
+ <include>*.properties</include>
|
|
|
+ </includes>
|
|
|
+ </resource>
|
|
|
+ </resources>
|
|
|
+ <outputDirectory>${project.build.directory}/config</outputDirectory>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+ </plugins>
|
|
|
+ </build>
|
|
|
+
|
|
|
</project>
|