【发布时间】:2012-07-26 02:37:49
【问题描述】:
我想从属性文件中读取一个用于配置构建插件的 Maven 变量。在其他项目文件中不需要它,例如上下文文件。
1) 做了一个配置文件(它可以工作,可以使用 mvn ... -P private)
<profile>
<id>private</id>
<properties>
<env>private</env>
</properties>
</profile>
2) 使用此内容创建过滤器文件(有效) foo.path=/home/foo/path
3) 尝试配置插件(不起作用)
<build>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>foo-plugin</artifactId>
<version>${foo-plugin.version}</version>
<configuration>
<!--<fooPath>home/foo/path></fooPath> that works -->
<fooPath>${foo.path}</fooPath> <!--works not -->
</configuration>
...
</build>
非常感谢
【问题讨论】: