pom.xml与*.properties 互相读取变量
1、pom.xml读取properties 变量
<plugins>
<!-- 读取配置文件 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>properties 文件地址</file>
</files>
</configuration>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>properties 文件地址</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
2、properties文件读取pom.xml中变量
<resource>
<directory>${project.basedir}/properties</directory>
<filtering>true</filtering>
<includes>
<include>*.properties</include>
</includes>
</resource>