The stuff you put into <source/> is actually compiled as Groovy source code and run inline. I am not sure how GMaven translates this into an assumption that you want to execute an external file. However, I would try giving it the full path to the file, as in the following example:
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>${pom.basedir}/src/main/script/myscript.groovy</source>
</configuration>
</execution>
</executions>
</plugin>
Jason Smith
________________________________________
From: Tom Nichols [tmnichols@(protected)]
Sent: Monday, February 08, 2010 1:21 PM
To: user
Subject: [groovy-user] GMaven - groovy:execute script file
I'm trying to run a groovy script file using GMaven. However GMaven
thinks I'm running an inline script:
[INFO] [groovy:execute {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO]
groovy.lang.MissingPropertyException: No such property:
myScript for class: script1265659774156
in my POM:
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>myScript.groovy</source>
</configuration>
</plugin>
Maybe it's just me but trying to use the same maven property for both
inline script and script file/url doesn't seem like the best idea
since they're very different types of data. I've also tried using
<source>${pom.basedir}/myScript.groovy</source> with the same results.
Am I doing something obviously wrong? Thanks.
-Tom
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email