`
cjx186
  • 浏览: 265428 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

maven最基本的建项目和运行

    博客分类:
  • java
 
阅读更多
建一个空的普通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补
  <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
*/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics