Basic Maven setup for a Groovy project that will be compiled into an executable uber-JAR.
This uses Maven wrapper for install-less Maven and the gmavenplus plugin for easily compiling Groovy from maven.
Change the artifact details in pom.xml.
<groupId>com.example</groupId>
<artifactId>groovy-maven-template</artifactId>
<version>0.0.1-SNAPSHOT</version>Change the main manifest under the maven-jar-plugin configuration to the name of your main class.
<mainClass>HelloWorld</mainClass>Linux/Mac:
./mvnw clean packageWindows:
mvnw.cmd clean packageThe generated uber-JAR will be located in the target directory, and can be run as normal with java -jar GENERATED_JARFILE.jar.
The other Maven lifecycle events still apply (e.g., mvn compile, mvn test, etc.). Testing is performed by the maven-surefire-plugin and packaging all dependencies is performed with maven-shade-plugin.