The examples on the referenced page are all using Maven "executions" which means that it binds the "execute" goal to a build phase. The configuration of "source" inside of an "execution" is only available for that execution. If you want to be able to "mvn groovy:execute" from the command-line, then you need something like:

<plugin>
    <groupId>org.codehaus.groovy.maven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <configuration>
        <source>
            println "Hi"
        </source>
    </configuration>
</plugin>

 * * *

This is basic Maven 101, nothing specific to GMaven, you might want to brush up on how to configure Maven. Though seems like a common problem folks have so I will add a note to the page.

--jason


On Dec 8, 2008, at 11:40 PM, Ning Zhao wrote:

Dear all,

I'd like to execute a local groovy script with the GMaven plugin (version 1.0.0 rc 3) , followed the instruction on this page:

http://groovy.codehaus.org/GMaven+-+Executing+Groovy+Code

every line in my pom.xml is double-checked. The only difference to the example is that my main Groovy class sits in

${pom.basedir}/src/main/groovy/com/mycompany/myproject/ CodeMaschine.groovy

But when I type:

mvn groovy:execute -Dmaven.test.skip

I always got this problem:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'groovy'.
[INFO] ------------------------------------------------------------------------
[INFO] Building GenerateCpp
[INFO]    task-segment: [groovy:execute]
[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------ [INFO] One or more required plugin parameters are invalid/missing for 'groovy:ex
ecute'

[0] Inside the definition for plugin 'groovy-maven-plugin' specify the following
:

<configuration>
...
<source>VALUE</source>
</configuration>.

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Dec 08 17:23:02 CET 2008
[INFO] Final Memory: 7M/15M
[INFO] ------------------------------------------------------------------------

Any help or hint would be greatly appreciated!


Best Regards,
Ellen

---------------------------------------------------------------------
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


Reply via email to