使用如下命令可以建立一個(gè)Struts2 Starter應(yīng)用程序

mvn archetype:create 

-DgroupId=tutorial

    -DartifactId=tutorial

    -DarchetypeGroupId=org.apache.struts \

    -DarchetypeArtifactId=struts2-archetype-starter \

    -DarchetypeVersion=2.0.5-SNAPSHOT

-DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository

 

參數(shù)含義:

 

參數(shù)

含義

groupId

當(dāng)前應(yīng)用程序隸屬的GroupID,通常是公司所有應(yīng)用程序的根目錄,例如:com.jpleasure

artifactId 

當(dāng)前應(yīng)用程序的ID

package

代碼生成時(shí)使用的根包的名字,如果沒有給出,默認(rèn)使用archetypeGroupId

archetypeGroupId

原型(archetype)的Group ID,因?yàn)槲覀冞@里使用的是Struts2的原型,所以這里總是org.apache.struts

archetypeArtifactId 

原型(archetypeID

archetypeVersion 

原型(archetype)版本

remoteRepositories 

包含原型(archetype)的遠(yuǎn)程資源庫(kù)的列表,如果部署在標(biāo)準(zhǔn)的maven資源庫(kù)或者本地,這不需要標(biāo)記本項(xiàng)

 

一些相關(guān)的Maven命令(注意要再項(xiàng)目目錄中運(yùn)行)

構(gòu)建

mvn install

創(chuàng)建IntelliJ IDEA項(xiàng)目文件

mvn idea:idea

創(chuàng)建Eclipse項(xiàng)目文件

  mvn eclipse:eclipse

運(yùn)行測(cè)試

mvn test

清除

mvn clean

打包

mvn package

獲得需要的JAR文件

mvn initialize

使用Jetty運(yùn)行

mvn jetty:run

ExtJS教程- Hibernate教程-Struts2 教程-Lucene教程