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文件內容大致如下.
------------------------------------- 我是分界線 -------------------------------------------------
未完成.
待修改.