maven的hello word

maven目錄結構java

src/main/java Application/Library sources
src/main/resources Application/Library resources
src/main/filters Resource filter files
src/main/webapp Web application sources
src/test/java Test sources
src/test/resources Test resources
src/test/filters Test resource filter files
src/it Integration Tests (primarily for plugins)
src/assembly Assembly descriptors
src/site Site
LICENSE.txt Project's license
NOTICE.txt Notices and attributions required by libraries that the project depends on
README.txt Project's readme

 建立標準目錄模板web

mvn archetype:generate -DgroupId=net.yun10000.test -DartifactId=maven-helloword -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DpackageName=net.yun10000.test.maven.helloword

如建立web項目apache

mvn archetype:generate -DgroupId=net.yun10000.test -DartifactId=maven-helloword-web -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false -DpackageName=net.yun10000.test.maven.helloword

經常使用命令:bash

  1. 編譯源代碼
    mvn compile
  2. 清空
    mvn clean
  3. 測試
    mvn test
  4. 安裝當前工程到倉庫
    mvn install
  5. 打包
    mvn package
  6. 生成eclipse項目
mvn eclipse:eclipse

指定jdk版本app

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version><!--$NO-MVN-MAN-VER$-->
				<configuration>
					<encoding>UTF-8</encoding>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
相關文章
相關標籤/搜索