I need to pass in some args to a groovy script that is executed via the gmaven. I can do this no problem if I execute the script directly on the command line like so:
printArgs.groovy...
for (a in this.args) {
println("Argument: " + a)
}
command...
$groovy printArgs.groovy fe fi fo fum
output...
Argument: fee
Argument: fi
Argument: fo
Argument: fum
I can't see how to pass these args in to via the plugin though using mvn groovy:execute. Ideally, I want to set some default params in the plugin config, but be able to override them when i execute the command. It would be nice to be able to pass them as named-args too if possible.
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<configuration>
<source>${pom.basedir}/src/main/resources/printArgs.groovy</source>
</configuration>
</plugin>
The plugin documentation is a bit scarce (and also outdated). I see there is a 'properties' optional param but I don't think this is to be used for this purpose (or if it is, i can't get it to work!).
Cheers :)