maven是管理项目的,myeclipse是编写代码的。第一次写项目都要配置好多东西,很麻烦,now 来看看怎样新建一个maven项目。

工具/原料

 
  • myeclipse
  • maven

方法/步骤

 
  1.  

    因为教程使用的maven是自己下载配置的,并没有使用myeclipse自带的(高版本的myeclipse自带maven)。所以首先你要安装了maven。maven的下载安装可参考下面的经验

  2.  

    打开myeclipse(本经验中使用的是myeclipse2014),Window-->preferences。

  3.  

    找到myeclipse-->maven4myeclipse,如果你要下载源码和帮助文档就勾选上图中那两个框。

  4.  

    在maven4myeclipse下找到installations,把自己安装的maven添加进来。如图:

  5.  

    找到user settings。将user settings设置为maven项目下的cfon/settings.xml,确定。

  6.  

    新建一个web工程,勾选上add maven support,java version要在1.7及以上.

  7.  

    然后一路next,到项目结构那儿,选择maven的项目结构。

  8.  

    如果幸运的话,新建的项目没有错。如果提示错误:

    Failure to transfer org.apache.maven:maven-artifact:pom:2.0.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-artifact:pom:2.0.6 from/to central (http://repo.maven.apache.org/maven2): No connector available to access repository central (http://repo.maven.apache.org/maven2) of type default using the available factories pom.xml /hello line 1 Maven Configuration Problem

  9.  

    那样的话,打开Window-->preferences-->myeclipse-->maven4myeclipse--->user settings把local repository里面的地址复制。

    如果你的myeclipse没有的话,就找到:

    c:\users\{你的电脑账号}\.m2\repository (一般在这个文件夹里)。

    比如我的:c:\users\long\.m2\repository

  10.  

    找打repository文件及后,在里面搜索 maven*.lastupdated。把搜出来的文件都删了。

  11.  

    重启myeclipse,右键项目--->maven4myeclipse--->update project...

  12.  

    勾选Force Update of Snapshots/Releases,然后ok退出,如果还是错误,不要着急,先等一会。如果过了一会还是有错,那就问度娘吧。如果解决了,记得投我一票哦。

最新文章

  1. shell 条件判断语句整理
  2. sql 2012 提示列名无效 但可以执行问题
  3. cocos2d-x的lua脚本加载CocostudioUI两种方式
  4. 关于java中线程休眠的另一种写法
  5. git clone简介
  6. JavaEE基础(十四) /正则
  7. Git笔记 整理2
  8. 浅谈C++源码的过国内杀软的免杀
  9. Django – vicalloy's trac
  10. undrop for innodb c_parser 源码分析
  11. JS 在 HTML 中做加减乘除
  12. Windows Server 2003下配置IIS6.0+php5+MySql5+PHPMyAdmin环境
  13. 函数FindFirstFile
  14. wdcp使用记录--持续更新
  15. 解决maven项目Cannot change version of project facet Dynamic web module to 3.0
  16. Hibernate框架笔记01_环境搭建_API_CRUD
  17. 50款经典电影效果LR预设
  18. 【暴力枚举&BFS】Flow Free @RMRC2017/upcexam5124
  19. 火币网API文档——WebSocket API错误码
  20. [洛谷 P1559] 运动员最佳匹配问题

热门文章

  1. bootstrap 列表 表格 表单 复选 单选 多选 输入框组
  2. css中transition的使用以及:before:after的使用(小样式)
  3. android内存优化相关1
  4. 关于android中Bundle的使用
  5. The Cow Lexicon
  6. U3D UGUI学习2 - Canvas
  7. 浅谈CSS样式png、gif、jpg图片优化的方法
  8. 手把手教你修改iOS版QQ的运动步数
  9. [转]人人网首页拖拽上传详解(HTML5 Drag&Drop、FileReader API、formdata)
  10. Ios中时间无法响应