eclipse版本需要3.3以上.
update url : m2eclipse - http://m2eclipse.sonatype.org/sites/m2e
安装后可以在项目右键看到maven的菜单.
选择 Maven-> EnableDependency Management
前提是项目下面要有pom.xml配置文件.(我现在的项目. xxx自己替换自己所需要的)
下面是pom.xml的模板. 具体参数可以参考()
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2008-2011 Sonatype, Inc.
All rights reserved. Includes the third-party code listed at http://www.sonatype.com/products/nexus/attributions.
Sonatype and Sonatype Nexus are trademarks of Sonatype, Inc. Apache Maven is a trademark of the Apache Foundation.
M2Eclipse is a trademark of the Eclipse Foundation. All other trademarks are the property of their respective owners.
-->
<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">
<mirrors>
<mirror>
<!-- This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>${baseurl}/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!-- Enable snapshots for the built in central repo to direct -->
<!-- all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!-- make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<pluginGroups>
<!-- define the sonatype plugin group, so the nexus plugins will work without typing the groupId -->
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups>
</settings>
上面这些配置是和 C:/Documents and Settings/xxxxxuser/.m2/settings.xml 协同工作的.
settings.xml文件内容大致如下.
------------------------------------- 我是分界线 -------------------------------------------------
未完成.
待修改.