您的位置:首页 > 编程语言 > Java开发

maven eclipse(1)搭建

2016-05-13 14:43 513 查看
1、准备工作。

下载最新eclipse版本(楼主目前版本4.5.2)。

下载地址:eclipse 下载

选择java开发版本:



选择下载源头:



2、设置eclipse maven

这里使用eclispe自带maven。



3、设置setting.xml、代理、本地仓库地址



其中setting.xml如下:

<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
-->
<!-- 本地仓库地址 -->
<localRepository>E:/JOB/VanclSearch/repository</localRepository>
<!-- 代理服务器  -->
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>127.0.0.1</host>
<port>1080</port>
<username></username>
<password></password>
</proxy>
</proxies>
<!-- 编译版本,jdk版本可以随意调整 -->
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>
</settings>
4、设置eclipse代理,这里的代理和maven setting.xml的proxy代理一致。



设置这个代理的原因,创建maven项目的时候需要选择



回去对应仓库下载jar包,如果没有设置代理会报错,这里一劳永逸。

好了,整个maven搭建就结束了,下面就是开发了。相对于eclipse 3.7的版本搭建要容易很多。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: