Skip to end of metadata
Go to start of metadata

If you already have Maven installed, then GMaven is the quickest path to running some Groovy tools!

Groovy Shell

Provides very convenient command-line access to the Groovy language:

mvn groovy:shell

Which should look something like this:

For more information please see the documentation for Groovy Shell.

Groovy Console

For folks that prefer a GUI over command-line access:

mvn groovy:console

After running, Maven will spit out something similar to this:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'groovy'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [groovy:console] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [groovy:console]

And then display the GUI console window, waiting for it to be closed before continuing:

For more information please see the documentation for Groovy Console.

Resources

Goal Documentation

  • No labels

1 Comment

  1. Updated: Apparently, MGROOVY-149, suggests that what my comment asks for has already been implemented quite some time ago... but it doesn't work for me, nor does the terminal option.  Perhaps it's because my code is all test code.

    Original comment retained for posterity:

    This is a great tool and a nice fast way of opening a Groovy shell on a machine that doesn't already have Groovy installed... however, it is very disappointing that this doesn't automatically open the shell in the context of the Maven project.

    I was hoping that when running this in a directory that contained a pom.xml file, that it would be smart enough to add all of the dependencies to the classpath along with the target/classes directory and any profile properties so that it could be used as a quick way to experiment and debug project code.  As it stands, it's almost useless for such purposes.  I think this is a missed opportunity for what could have been a much more useful tool.