1)maven安裝
一般我們從github、碼雲(https://gitee.com)上獲取代碼后,實際上我們並沒有一個版本管理工具來用來獲取(get)、提交(commit and push)代碼的工具,因此需要使用一個代碼提交管理工具,maven是這類工具中比較好的工具。
聲明:maven安裝請參考:《Java-Maven(一):Maven的簡介與安裝》

備注:本地已經安裝好了maven,安裝目錄為:D:\Work\Java\apache-maven-3.5.0-bin\apache-maven-3.5.0
2)給idea從github、碼雲等獲取到的項目綁定 maven:


3)修改pom.xml,添加資源庫管理插件配置(可忽略):
1 <pluginRepositories> 2 <pluginRepository> 3 <id>scala-tools.org</id> 4 <name>Scala-Tools Maven2 Repository</name> 5 <url>http://scala-tools.org/repo-releases</url> 6 </pluginRepository> 7 </pluginRepositories>
4)配置遠程中央倉庫:
一般情況下可以配置為國外的遠程中央倉庫,但是在國內從國外遠程中央倉庫下載jar包的速度比較差。如果國內的話,建議使用阿里的遠程中央倉庫(下載速度快)。配置阿里的遠程中央倉庫有兩種方案:
配置方式一:
conf\setting.xml
1 <mirrors> 2 <mirror> 3 <id>alimaven</id> 4 <name>aliyun maven</name> 5 <url>http://maven.aliyun.com/nexus/content/groups/public/</url> 6 <mirrorOf>central</mirrorOf> 7 </mirror> 8 </mirrors>
配置方式二:
在項目的pom.xml中配置:
1 <repositories> 2 <repository> 3 <id>sonatype-nexus-snapshots</id> 4 <name>Sonatype Nexus Snapshots</name> 5 <url>http://maven.aliyun.com/nexus/content/groups/public</url> 6 <releases> 7 <enabled>false</enabled> 8 </releases> 9 <snapshots> 10 <enabled>true</enabled> 11 </snapshots> 12 </repository> 13 </repositories>
