maven目录结构
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 |
创建标准目录模板
mvn archetype:generate -DgroupId=net.yun10000.test -DartifactId=maven-helloword -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DpackageName=net.yun10000.test.maven.helloword
如创建web项目
mvn archetype:generate -DgroupId=net.yun10000.test -DartifactId=maven-helloword-web -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false -DpackageName=net.yun10000.test.maven.helloword
常用命令:
mvn eclipse:eclipse
指定jdk版本
<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>