【发布时间】:2015-07-31 00:50:47
【问题描述】:
我正在尝试使用 gmaven 覆盖 maven 中的以下属性:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<id>setproperty</id>
<phase>validate</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
pom.properties['main.build.directory']=project.parent.build.directory.absolutePath.replace('\\','/');
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
但我收到此错误:;
[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.5:execute (setproperty) on project my-project: startup failed, script139276
2592853.groovy: 1: expecting ''', found '<EOF>' @ line 1, column 84.
[ERROR] 1 error
上面的 groovy sn-p 有什么问题?
【问题讨论】:
-
为什么需要更改 main.build.directory 并使用 project.parent ?可以详细说明一下...
-
它是构建转换中临时步骤的一部分 - 一些旧的遗留代码稍后将被删除。但现在我们需要操作内置属性
标签: maven groovy gmaven-plugin