Skip to content

Instantly share code, notes, and snippets.

@admackin
Created August 14, 2014 01:29
Show Gist options
  • Save admackin/d37cb5ee56ac608f7017 to your computer and use it in GitHub Desktop.
Save admackin/d37cb5ee56ac608f7017 to your computer and use it in GitHub Desktop.
Execute Java class in Maven Project using exec-maven-plugin
#!/bin/sh
# Don't forget to add the plugin to your POM - eg:
# <plugin>
# <groupId>org.codehaus.mojo</groupId>
# <artifactId>exec-maven-plugin</artifactId>
# <version>1.3.2</version>
# </plugin>
MAINCLASS=$1
shift
mvn -f ${0%/*/*}/pom.xml exec:java -Dexec.mainClass=$MAINCLASS -Dexec.args="$*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment