使用 Maven pom 导出 xml 文件中的值
Using maven pom to export values in xml file
有人能告诉我是否可以将值从 Maven pom.xml 导出到另一个 xml 文件。我试过这种方法,但没有用。
Pom.xml
<properties>
<database.url>jdbc:mysql://localhost:3306/test</database.url>
</properties>
OtherFile.xml
<database id="prod_db" url="${database.url}" driver="com.mysql.jdbc.Driver" user="a" password="b" />
xml 文件无法理解是什么。
使用 Pom 文件语法将包含 xml 文件的文件夹设为资源文件夹,并确保将筛选设置为 true。
...
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
...
有人能告诉我是否可以将值从 Maven pom.xml 导出到另一个 xml 文件。我试过这种方法,但没有用。
Pom.xml
<properties>
<database.url>jdbc:mysql://localhost:3306/test</database.url>
</properties>
OtherFile.xml
<database id="prod_db" url="${database.url}" driver="com.mysql.jdbc.Driver" user="a" password="b" />
xml 文件无法理解是什么。
使用 Pom 文件语法将包含 xml 文件的文件夹设为资源文件夹,并确保将筛选设置为 true。
...
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
...