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
mvn compile
mvn clean
mvn test
mvn install
mvn package
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>