jakub holý

building the right thing, building it right, fast

Note to Self: Running GroovyConsole with a Maven Project''s Classpath

2011-10-02Tools

It's pretty useful to have the ability to eperiment interactively with some API using the (desktop) Groovy Console. If the API is in a Maven project, just add dependency on Groovy to your pom.xml:


<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>1.8.2</version>
</dependency>


And execute the console from the project's folder using the exec plugin:


mvn exec:java -Dexec.mainClass="groovy.ui.Console"


Enjoy.