前言
场景:A工程里有配置文件a.properties,B工程引用了A工程,让B工程同时可以使用A里面的a.properties
转载自:https://blog.csdn.net/m0_57363611/article/details/125322058
配置信息
<!--将配置文件从jar独立出来,实现动态修改配置文件-->
<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>
<outputDirectory>${project.build.directory}/resources</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>