May 25, 2018

Create a Java Project from command line

Open a command-line window (or Terminal in Linux).
Got to the directory where you want to store the project.
Generate a Maven project:
mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-grizzly2 -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=ca.i88 -DartifactId=simple-service -Dpackage=ca.i88 -DarchetypeVersion=2.25.1