eclipse maven环境安装配置

2015.05.18 15:20 Mon | 482次阅读 | maven

1.结论

不要在线安装 Eclipse 的 maven 插件!

不要在线安装 Eclipse 的 maven 插件!

不要在线安装 Eclipse 的 maven 插件!

重要的事情要说三遍

2.过程

在线安装eclipse插件:Help --> Install New Software,然后输入 HTTP 地址(http://download.eclipse.org/technology/m2e/milestones/)来安装

下载很慢,但一切正常,临安装时报错

Cannot complete the install because one or more required items could not be found.
  Software being installed: m2e - Maven Integration for Eclipse (includes Incubating components) 1.5.2.20150413-2215 (org.eclipse.m2e.feature.feature.group 1.5.2.20150413-2215)
  Missing requirement: Maven Integration for Eclipse JDT 1.5.2.20150413-2215 (org.eclipse.m2e.jdt 1.5.2.20150413-2215) requires 'bundle org.slf4j.api 1.6.2' but it could not be found
  Cannot satisfy dependency:
    From: m2e - Maven Integration for Eclipse (includes Incubating components) 1.5.2.20150413-2215 (org.eclipse.m2e.feature.feature.group 1.5.2.20150413-2215)
    To: org.eclipse.m2e.jdt [1.5.2.20150413-2215]

错误原因很简单,缺包:org.slf4j.api 1.6.2

网上各种介绍说下载个 org.slf4j.api.jar 扔到 plugins 文件夹即可解决问题

但我反复试过,不行,好几个版本的都不行

最终找到解决方案:在线安装slf4j.api

具体步骤如下:

1.Help->Install New Software
2.Work with填写:http://www.fuin.org/p2-repository/ ,会有一段加载时间 -> 搜索框填写slf
3.在Maven osgi-bundles下选中slf4j-api,然后next...
4.重启eclipse

再次安装 maven,这次换了个错误

    Cannot complete the install because one or more required items could not be found.
  Software being installed: m2e - slf4j over logback logging (Optional) 1.5.2.20150413-2215 (org.eclipse.m2e.logback.feature.feature.group 1.5.2.20150413-2215)
  Missing requirement: Maven Integration for Eclipse 1.5.0.20140606-0033 (org.eclipse.m2e.core 1.5.0.20140606-0033) requires 'bundle com.google.guava [14.0.1,16.0.0)' but it could not be found
  Missing requirement: Maven Integration for Eclipse 1.5.1.20150109-1820 (org.eclipse.m2e.core 1.5.1.20150109-1820) requires 'bundle com.google.guava [14.0.1,16.0.0)' but it could not be found
  Missing requirement: Maven Integration for Eclipse 1.5.2.20150413-2215 (org.eclipse.m2e.core 1.5.2.20150413-2215) requires 'bundle com.google.guava [14.0.1,16.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: Maven Integration for Eclipse 1.5.0.20140606-0033 (org.eclipse.m2e.core.ui 1.5.0.20140606-0033)
    To: bundle org.eclipse.m2e.core [1.5.0,1.6.0)
  Cannot satisfy dependency:
    From: Maven Integration for Eclipse 1.5.1.20150109-1820 (org.eclipse.m2e.core.ui 1.5.1.20150109-1820)
    To: bundle org.eclipse.m2e.core [1.5.0,1.6.0)
  Cannot satisfy dependency:
    From: Maven Integration for Eclipse 1.5.2.20150413-2215 (org.eclipse.m2e.core.ui 1.5.2.20150413-2215)
    To: bundle org.eclipse.m2e.core [1.5.0,1.6.0)
  Cannot satisfy dependency:
    From: m2e logback appender 1.5.2.20150413-2215 (org.eclipse.m2e.logback.appender 1.5.2.20150413-2215)
    To: bundle org.eclipse.m2e.core.ui [1.5.0,1.6.0)
  Cannot satisfy dependency:
    From: m2e - slf4j over logback logging (Optional) 1.5.2.20150413-2215 (org.eclipse.m2e.logback.feature.feature.group 1.5.2.20150413-2215)
    To: org.eclipse.m2e.logback.appender [1.5.2.20150413-2215]

原因是:最新的maven支持的是eclipse4+,而我用的eclipse是3.7,插件版本太高

解决方案是重新下载低版本的maven插件:http://download.eclipse.org/technology/m2e/milestones/1.4

这次终于一切正常了

3.总结

1.下载速度太慢

由于两次下载maven,一次下载slf4j,等的时间太长

即便知道问题所在后,可以少下载一次maven,时间也太长

2.网上的众口一词的答案未必适合自己!

  • RudySmall 2018-01-20 07:26:47

    I have checked your site and i've found some duplicate content, that's why you don't rank high in google's search results, but there is a tool that can help you

    to create 100% unique content, search for; Boorfe's tips

    unlimited content

  • WoodrowChief 2018-03-12 04:48:06

    I have checked your blog and i've found some duplicate content, that's why

    you don't rank high in google, but there is a tool that can help you to create 100% unique content, search for: Best

    article rewritwer Ercannou's essential tools

  • LidaBold 2018-06-04 04:44:29

    I have checked your website and i have found some duplicate content, that's why you don't rank high in google,

    but there is a tool that can help you to create 100% unique articles,

    search for; SSundee advices unlimited content for your blog