主要使用maven的插件 1,pom.xml配置
<plugin>
<groupId>com.juvenxu.portable-config-maven-plugin
</groupId>
<artifactId>portable-config-maven-plugin
</artifactId>
<version>1.1.4
</version>
<executions>
<execution>
<goals>
<goal>replace-package
</goal>
</goals>
</execution>
</executions>
<configuration>
<portableConfig>/home/caiyp/test/config/zplay_service/jdbc.xml
</portableConfig>
</configuration>
</plugin>
2,
设置参数 3, 将配置文件的信息同步到/home/caiyp/test/config/zplay_service/jdbc.xml 的位置,maven在打包的时候会将下的文件根据key值自动替换
转载请注明原文地址: https://ju.6miu.com/read-679601.html