我遇到一个问题,当我通过 Intellij 15.0.2 的 Maven 构建运行时,Maven 资源插件没有将我的属性过滤到我的文件中。当我mvn compile
从 Windows 命令行运行时,它确实有效。我的插件配置是:
<properties>
<prop1>aaa</prop1>
<prop2>bbb</prop2>
</properties>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>file1</include>
<include>file2</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>