根据开发场景需要,在*.properties或者*.xml中读取pom.xml中配置的参数,如下在pom.xml中的<properties></properties>中配置自己的参数。
<properties>
<mypath>../logs/${project.name}</mypath>
</properties>
然后再在<build></build>中加上如下配置,指定需要使用参数的文件
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.properties</include>
<include>*.xml</include>
</includes>
</resource>
</resources>