JAVA資格認(rèn)證:AppFuse快速構(gòu)建JavaEE

字號:

1.安裝maven2.0,因?yàn)槲业氖切@網(wǎng)不能訪問國際網(wǎng)站,配置代理,在conf下面的setting.xml中:
    
    
    optional
    true
    http
    用戶名
    密碼
    代理服務(wù)器ip地址
    端口
    

    

    2.構(gòu)建不同的Project,使用不同的命令http://appfuse.org/display/APF/AppFuse+QuickStart#AppFuseQuickStart-create
    可以把下載好的AppFuse放在~/.m2/repository下面,這樣就省著從網(wǎng)上下載了?。ǔ模﹚indows:C:\Documents and Settings\Administrator.FB30291BC833430\.m2\repository
    我構(gòu)建的是struts2(配置代理第一次運(yùn)行時(shí),mvn要加上-U參數(shù)):
    mvn -U archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject
    可能會(huì)花上幾分鐘的時(shí)間
    上面出現(xiàn)了success后!默認(rèn)在C:\Documents and Settings\Administrator下面有myproject目錄。把myproject目錄下的pom.xml中的最下面兩行:root
    為root添加上對應(yīng)的密碼!如果項(xiàng)目沒有使用到AspectJ的話,就將pom.xml中和AspectJ相關(guān)的配置刪除,否則會(huì)出現(xiàn)Unable to find the mojo ’org.codehaus.mojo:aspectj-maven-plugin:1.0錯(cuò)誤!
    進(jìn)入到myproject目錄下面運(yùn)行mvn命令!
    直到出現(xiàn)seccessfully!
    執(zhí)行mvn jetty:run-war
    最后http://localhost:8080即可打開主頁了,默認(rèn)的是admin/admin 普通用戶是:user/user。