maven最基本的建项目和运行

阅读更多
建一个空的普通app项目
mvn archetype:create -B -DgroupId=net.jwsz.snap -DartifactId=snap

/*
    //Create Maven Applaction Project
    mvn archetype:create -B -DgroupId=net.jwsz.snap -artifactId=snap 
    //Run Maven Application
    mvn clean compile exec:java -Dexec.mainClass="net.jwsz.snap.App"
    //
    mvn exec:java -Dexec.mainClass="net.jwsz.snap.App" -Dexec.args="arg0 arg1 arg2"
*/

建一个空的webapp项目struts+spring
mvn archetype:create -DgroupId=me.cjx.$(CurSel).action -DartifactId=$(CurSel) -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11.2-SNAPSHOT -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository


/*
    //Create Maven WebApp Project
    mvn archetype:create -DgroupId=net.jwsz.webapp -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
    //pom.xml补
      
              
                maven-compiler-plugin  
                  
                    1.6  
                    1.6  
                    UTF-8  
                  
              
          
        org.mortbay.jetty    
        maven-jetty-plugin  
        6.1.6     
          
              10  
          
          
    
    //Run Maven WebApp
    mvn clean compile jetty:run
*/

你可能感兴趣的:(maven最基本的建项目和运行)