maven的默认目录设置
<build>
<!--默认源代码目录-->
<sourceDirectory>src/main/java </sourceDirectory>
<!--默认测试源代码目录-->
<testSourceDirectory>src/test/java</testSourceDirectory>
<!--默认资源目录-->
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<!--默认测试资源目录-->
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
Java web项目中使用maven jetty插件
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.6.v20170531</version>
<configuration>
<httpConnector>
<port>9090</port>
</httpConnector>
</configuration>
</plugin>
指定JDK版本
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
依赖管理相关命令
mvn dependency:list
mvn dependency:tree
mvn dependency:analyze
maven学习资源:
https://segmentfault.com/a/1190000005044702
maven modules:http://juvenshun.iteye.com/blog/305865