Eclipse配置Maven
Posted 简之轩
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eclipse配置Maven相关的知识,希望对你有一定的参考价值。
1.软件环境
Eclipse Juno Service Release 2
2.Eclipse配置Maven
(1)Help -> Install New Software... -> Add 输入对应的值
> Name = m2e(这个值随意)
> Location = http://download.eclipse.org/technology/m2e/releases
(2)勾上所有的Maven Integration for Eclipse,点击Next
此时会有如下的错误:
错误信息:
Your original request has been modified.
"m2e - Maven Integration for Eclipse (includes Incubating components)" is already installed, so an update will be performed instead.
"m2e - slf4j over logback logging (Optional)" is already installed, so an update will be performed instead.
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.0.20140606-0033 (org.eclipse.m2e.logback.feature.feature.group 1.5.0.20140606-0033)
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
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: m2e logback appender 1.5.0.20140606-0033 (org.eclipse.m2e.logback.appender 1.5.0.20140606-0033)
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.0.20140606-0033 (org.eclipse.m2e.logback.feature.feature.group 1.5.0.20140606-0033)
To: org.eclipse.m2e.logback.appender [1.5.0.20140606-0033]
"m2e - Maven Integration for Eclipse (includes Incubating components)" is already installed, so an update will be performed instead.
"m2e - slf4j over logback logging (Optional)" is already installed, so an update will be performed instead.
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.0.20140606-0033 (org.eclipse.m2e.logback.feature.feature.group 1.5.0.20140606-0033)
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
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: m2e logback appender 1.5.0.20140606-0033 (org.eclipse.m2e.logback.appender 1.5.0.20140606-0033)
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.0.20140606-0033 (org.eclipse.m2e.logback.feature.feature.group 1.5.0.20140606-0033)
To: org.eclipse.m2e.logback.appender [1.5.0.20140606-0033]
导致这个插件无法安装,这是因为这个插件版本过高导致的,我们需要在重新选择插件版本,如下图,我们将Show only the latest versions of available software,然后选择1.4版本的即可
(3)然后一路按照提示.Next即可,装完后,他会提示重启Eclipse,重新启动就可以了!
(4)重启Eclipse后,选择Windows -> Preferences -> Maven -> Installations
(5)点击Add,选择我们自己的Maven路径,将他与Eclipse插件关联起来,点击Apply
(6)选择Maven -> User Settings,设置User Settings为我们的Maven目录下的conf目录下的settings.xml文件即可,点击Apply
(7)到此为止,Eclipse上的Maven插件就配置好了,就可以创建Maven工程了。
以上是关于Eclipse配置Maven的主要内容,如果未能解决你的问题,请参考以下文章
未找到模块 OpenJDK 12 Maven Eclipse