码迷,mamicode.com
首页 > 系统相关 > 详细

用Eclipse构建Maven项目

时间:2015-10-18 22:42:32      阅读:322      评论:0      收藏:0      [点我收藏+]

标签:

Eclipse中m2eclipse插件的安装

Help>Install New Software

技术分享

Click Add

Name: m2e

Location: http://download.eclipse.org/technology/m2e/releases

技术分享

Click OK

技术分享

It seems that the plug-in has already been installed in this version of eclipse. If not, just click next until the last and restart eclipse.

Configuration:

  1. 绑定maven的安装目录

Window>Preferences

技术分享

Click Add and add the installation home of maven

技术分享

Click Finish choose the item

技术分享

Click Apply and OK

  2. 设置自定义本地仓库

Open settings.xml

技术分享

修改默认的本地仓库位置

<localRepository>F:/m3/repository</localRepository>

修改默认的中央仓库镜像

<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>ibiblio</id>
      <mirrorOf>central</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://mirrors.ibiblio.org/maven2/</url>
    </mirror>
  </mirrors>

保存所做的修改,同时还需要把这个settings.xml文件复制一份到“F:/m3”目录下

技术分享

Window>Preferences

技术分享

Create a new maven project

技术分享

Choose maven-archetype-webapp

如果这一步出错了,请参考 http://jingyan.baidu.com/article/63acb44ad96e4b61fcc17ecf.html

技术分享

Group Id: 基本包名

Artifact Id: 项目名

技术分享

技术分享

用Eclipse构建Maven项目

标签:

原文地址:http://www.cnblogs.com/wqsbk/p/4890303.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!