我正在通过 pom.xml 中的 gmaven 插件运行外部 groovy 脚本。外部脚本是“myscript.groovy”。
我想通过 maven pom.xml [即在插件“gmaven-plugin”执行中]向 myscript.groovy 提供一些参数/参数;但不能这样做..
我试过使用 in ; 但不确定如何在 groovy 脚本中检索其值。简单地调用 properties.get 并没有给出属性值。
pom文件截图:
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<id>generate-resources-execute-groovyscript</id>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<properties>
<property>
<name>installation.dir</name>
<value>${installation.dir}</value>
</property>
</properties>
<source>${pom.basedir}/src/main/groovy/configure.groovy</source>
</configuration>
</execution>
</executions>
</plugin>
不确定如何在“configure.groovy”脚本中检索“installation.dir”属性的值。
这方面的任何提示都会很有用..谢谢