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"
*/

建一个空的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补
  <plugins>    
            <plugin>  
                <artifactId>maven-compiler-plugin</artifactId>  
                <configuration>  
                    <source>1.6</source>  
                    <target>1.6</target>  
                    <encoding>UTF-8</encoding>  
                </configuration>  
            </plugin>  
      <plugin>    
        <groupId>org.mortbay.jetty</groupId>    
        <artifactId>maven-jetty-plugin</artifactId>  
        <version>6.1.6</version>     
        <configuration>  
              <scanIntervalSeconds>10</scanIntervalSeconds>  
        </configuration>  
      </plugin>    
    </plugins>
    //Run Maven WebApp
    mvn clean compile jetty:run
*/

猜你喜欢

转载自ogc.iteye.com/blog/1608738