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