Eclipse 配置Maven以及修改預設Repository

來源:互聯網
上載者:User

標籤:eclipse   maven   setting   repository   

今天將Eclipse關於Maven的配置總結一下,方便以後配置。

一.配置Maven環境

1.下載apache-maven檔案,選擇自己需要的版本,地址:http://mirrors.cnnic.cn/apache/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.zip

2.解壓1所下載檔案,本人解壓到:D:\Software_IDE\apache-maven-3.0.4

3.配置Maven環境變數

a. MAVEN_HOME:D:\Software_IDE\apache-maven-3.0.4

b.PATH:%MAVEN_HOME%\bin;

4.在CMD中輸入mvn -v,如出現下列資訊,表示配置成功。

其中會顯示Java 配置環境以及Maven配置環境


二.修改Maven倉庫路徑

本人希望放在D盤,個人根據自身情況而定

1.在D盤建立檔案,如下:


2.配置D:\m2中setting.xml檔案,內容如下:

<span style="font-family:KaiTi_GB2312;font-size:18px;"><?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><pluginGroups /><proxies /><servers /><mirrors /><localRepository>D:/m2/repository</localRepository></settings></span>
3.配置D:\Software_IDE\apache-maven-3.0.4\conf中setting.xml檔案,找到LocalRepository,修改所需要的路徑

<span style="font-family:KaiTi_GB2312;font-size:18px;"><localRepository>D:\m2\repository</localRepository></span>
三.eclipse中配置Maven

1.開啟Eclipse,找到Window->Preferences->Maven,


2.配置setting


好了,大功告成,可以試試。




Eclipse 配置Maven以及修改預設Repository

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.