我已经嵌入我的POM中下面的代码:出口Maven的性质
<plugin name="test">
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<configuration>
<tasks>
<pathconvert targetos="unix" property="project.build.directory.portable">
<path location="${project.build.directory}"/>
</pathconvert>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
我然后引用${project.build.directory.portable}
从run project
行动,但它回来作为null
。在Ant块中执行<echo>
显示正确的值。我究竟做错了什么?
嗯,它真的有用吗?根据这个问题我有一些麻烦(http://maven.40175.n5.nabble.com/exportAntProperties-not-working-in-3 -0-4-td5732071.html) – milgoff 2014-01-06 08:49:55
尝试将exportAntProperties设置为全局配置,而不是执行配置 – Joram 2014-01-13 13:07:09
我注意到这不会覆盖已经在POM中声明的属性,但是如果我不声明属性my linter(使用IntelliJ)抱怨未知的属性符号。有没有办法告诉它忽略这个,或者告诉插件重写一个现有的属性? – 2015-09-11 20:07:19