我有Maven POM文件的一些配置,在插件部分,我有maven tomcat插件,其中有一些配置如下:
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>tomcat</server>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我想将url设置导出到某个属性文件,例如使用该键的tomcat.properties:
url=http://localhost:8080/manager/html
Run Code Online (Sandbox Code Playgroud)
如何在POM文件中读取此密钥?
我正在尝试将属性从pom.xml加载到application.properties中.我想创建两个配置文件:dev和prod以使用不同的数据库URL.我在我的所有应用程序中使用Jenkins作为CI(主要是Spring MVC,没有Boot项目)正在使用maven配置文件部署到Tomcat.使用maven属性有可能做到这一点吗?我试过这样的事情:
spring.datasource.url=${jdbc.url}