eclipse中配置maven

  • maven安装

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

  • eclipse中安装maven插件

              一、在线安装,经过Help中的eclipse Maketplace进行安装。java

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

  • maven配置

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

 

       <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>
     -->
	<mirror>
		<id>nexus-osc</id>
		<mirrorOf>*</mirrorOf>
		<name>Nexus osc</name>
		<url>http://maven.oschina.net/content/groups/public/</url>
	</mirror>
  </mirrors>



  • 建立maven项目

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

 

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

 

  • 参考资料

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

  • spring frame直接下载地址

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