在Eclipse配置 Maven方法

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文件内容大致如下.

 

 

------------------------------------- 我是分界线 -------------------------------------------------

未完成.

待修改.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值