我想从pom.xml中获取artifactId并使用此artifactId来填充属性文件。使用pom.xml填充环境属性文件proeprties
的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxxxx</groupId>
<artifactId>fm-service</artifactId>
<packaging>war</packaging>
<version>x.x.x-SNAPSHOT</version>
</project>
application.preperties
email.subject = "ALERT - [artifactId from pom.xml]"
是有可能这样做?如果是的话,如果没有,那么请提出替代方案。
属性文件是否已经存在,或者您是否想从头开始编写它?另外,你想在maven中做到这一点,或者它并不重要? – Kraylog
是的属性文件存在,我希望它在maven中。 – rohanagarwal