Maven common command

create a new project

  • mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false (The groupId is the name space, for example com.autofei. The artifactId is the project name)
  • mvn eclipse:eclipse (convert maven project into eclipse project)
  • mvn package (create jar file)
  • java -cp target/{jar-name} {main-class-name}

create a new web project

  • mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
  • mvn eclipse:eclipse -Dwtpversion=2.0 (convert maven project into eclipse web project)
  • mvn package
  • deploy war file into container

list all template: mvn archetype:generate

run compile: mvn compile

run liquibase: mvn -P update-db process-resources

run install with multi threads: mvn clean -Dmaven.test.skip=true install -T 16

run gwt: mvn clean -Pgwt-dev-auto -Dmaven.test.skip=true install -T 16

reference: http://www.mkyong.com/tutorials/maven-tutorials/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s