Skip to content

Instantly share code, notes, and snippets.

@jvihrial
Created February 25, 2018 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvihrial/d15a655318747303de253f01cd08e2c5 to your computer and use it in GitHub Desktop.
Save jvihrial/d15a655318747303de253f01cd08e2c5 to your computer and use it in GitHub Desktop.
MAVEN commands
General help:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
1. Create a project:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
2. Build
mvn package
or
mvn clean compile
3. Run the jar:
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
or call the main class with maven (App is the class name)
mvn exec:java -Dexec.mainClass="com.mycompany.app.App"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment