<build><plugins>
以下配置放入此位置!
</plugins></build>
<!--配置文件外置-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--启动类-->
<mainClass>com.jkgis.bigdata.partybigdata.PartyBigdataApplication</mainClass>
<includeSystemScope>true</includeSystemScope>
<addResources>true</addResources>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</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>
<encoding>UTF-8</encoding>
<!--打成jar包后复制到的路径-->
<outputDirectory>
${project.build.directory}/properties/
</outputDirectory>
<resources>
<resource>
<!--项目中的路径-->
<directory>src/main/resources/</directory>
<includes>
<exclude>**/*.yml</exclude>
<exclude>**/*.properties</exclude>
<exclude>**/wsdzb.lic</exclude>
<exclude>**/publicCerts.keystore</exclude>
<exclude>**/rsa_public_key.key</exclude>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
打包:
配置文件:
把以上两个文件复制出来后放同意文件目录下,运行即可: