eclipse中配置maven

  • maven安装

              下载地址为:http://maven.apache.org/download.cgi,解压后存放在指定目录。在系统的环境变量中设置MAVEN_HOME,并在path中添加maven的bin路径。

  • eclipse中安装maven插件

              1、在线安装,通过Help中的eclipse Maketplace进行安装。

             2、离线安装,eclipse在线安装经常由于网速过慢无法安装,此时只能通过下载离线包进行安装。离线包直接百度下载,下载后解压,将features中内容拷贝到eclipse\features中,plugins文件夹中内容拷贝到eclipse\plugins目录中。

  • maven配置

              在maven的安装文件中有一个conf/settting.xml文件。设置本地中央仓库存储路径,

       <localRepository>F:\repository\maven</localRepository>
               有时候网络较差,maven默认的中央仓库无法访问,需要设置镜像配置

  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
<div>    <mirror>  
      <id>repository-master.mulesoft</id>  
      <mirrorOf>central</mirrorOf>  
      <name>repository-master.mulesoft.org.</name>  
      <url>https://repository-master.mulesoft.org/nexus/content/groups/public/</url>  
    </mirror>
    
   <mirror>  
      <id>sonatype</id>  
      <mirrorOf>*</mirrorOf>  
      <name>repository.sonatype.org.</name>  
      <url>https://repository.sonatype.org/content/groups/forge/</url>  
    </mirror></div>
  </mirrors>



  • 创建maven项目

             在eclipse的菜单中选择maven project后,修改pom.xml,添加

       <packaging>jar</packaging>
       <url>http://mvnrepository.com/</url>

  • 参考资料

             http://jingyan.baidu.com/article/db55b609a994114ba20a2f56.html
             http://blog.csdn.net/chuyuqing/article/details/28879477

  • spring frame直接下载地址

             http://repo.spring.io/libs-release-local/org/springframework/spring/4.1.7.RELEASE/


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值