参考原文:http://blog.csdn.net/wolffool/article/details/6259739
二、Eclipse插件安装
1) 插件安装
点击菜单 Help -> Install new software 进行插件安装
插件地址 http://m2eclipse.sonatype.org/sites/m2e
2) 配置文件使用与命令行工具所在目录的文件
点击菜单 Window -> Preferences ,然后选择左侧树中的 Maven -> User settings,
选择C:/apache-maven-3.0.3/conf/settings.xml,保存配置即可.
三、Nexus仓库配置,编辑C:/apache-maven-3.0.3/conf/settings.xml,内容参考如下:
<?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">
<!-- 本地 maven 仓库地址 -->
<localRepository>E:/workspace/MavenLocalRepository</localRepository>
<pluginGroups/>
<proxies/>
<!-- maven 仓库用户认证信息 -->
<servers>
<server>
<id>yihaodian-nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>yihaodian-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>yihaodian-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!-- maven 仓库本地镜像配置 -->
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>nexus local repo.</name>
<url>http://maven.yihaodian.cn/content/groups/public/</url>
</mirror>
</mirrors>
<!-- 公司 maven 仓库服务器地址配置 -->
<profiles>
<profile>
<id>myProfie</id>
<repositories>
<repository>
<id>yihaodian-nexus</id>
<name>YiHaoDian Nexus Repository</name>
<url>http://maven.yihaodian.cn/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>yihaodian-nexus</id>
<name>YiHaoDian Nexus Repository</name>
<url>http://maven.yihaodian.cn/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>myProfie</activeProfile>
</activeProfiles>
</settings>
附:
eclipse 3.6.1 安装maven插件失败的解决办法
推荐个不错的 maven 搜索网站。 http://www.boyunjian.com/do/jarse/index.html