11/09/2007

Maven 2: useful command lines

Web application
Create a Blank web app (war)
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.abb.example -DartifactId=example

Struts 1
Create a Struts Blank web app (war)
mvn archetype:create -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts-archetype-blank -DarchetypeVersion=1.3.5 -DgroupId=com.abb.example -DpackageName=com.abb.example.test -DartifactId=app-test (error: deprecated goal with this version)

Struts 2
Create a Struts 2 tutorial web app (war)
mvn archetype:create -DgroupId=tutorial -DartifactId=tutorial -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.9-SNAPSHOT -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository

WTP
Set the project as a web app in WTP (Eclipse Web Tool)
mvn clean eclipse:clean eclipse:eclipse -Dwtpversion=1.5
Add in pom.xml:
  maven-eclipse-plugin, configuration wtpversion = 1.5
and maybe:
  maven-compiler-plugin, 1.5 (in build plugins)


New projet
Create a java project (jar)
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app

...

Aucun commentaire: