Java 将 Maven 与 Eclipse Kepler 集成的问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18498938/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 08:36:49  来源:igfitidea点击:

Problems integrating Maven with Eclipse Kepler

javaeclipsemaven

提问by Man Friday

I am totally new to working with Maven in Eclipse. I am using the latest verion of Eclipse (Kepler). According other posts, as well as Eclipse's help page http://help.eclipse.org/kepler/index.jsp?topic=//org.eclipse.platform.doc.user/tasks/tasks-127.htm, I am supposed to try to install new software within Eclipse IDE.

我是在 Eclipse 中使用Maven 的新手。我正在使用Eclipse (Kepler)的最新版本。根据其他帖子,以及 Eclipse 的帮助页面http://help.eclipse.org/kepler/index.jsp?topic=//org.eclipse.platform.doc.user/tasks/tasks-127.htm,我是应该尝试在 Eclipse IDE 中安装新软件。

However, when I try to Add Eclipse's recommended m2e release, Eclipse gives me an error:

但是,当我尝试添加 Eclipse 推荐的 m2e 版本时,Eclipse 给了我一个错误:

Unable to read repository at http://download.eclipse.org/technology/m2e/releases. download.eclipse[...]releases is not a valid repository location.

无法在http://download.eclipse.org/technology/m2e/releases读取存储库。download.eclipse[...]releases 不是有效的存储库位置。

Essentially I run into the same problem no matter which approach I take outlined on the Eclipse help page. Is there some other/better way to integrate Maven with Eclipse? Are there steps I should have taken before this? All I have done so far is install Eclipse. How can I successfully get Maven running?

基本上,无论我在 Eclipse 帮助页面上概述了哪种方法,我都会遇到同样的问题。是否有其他/更好的方法将 Maven 与 Eclipse 集成?在此之前我应该​​采取哪些步骤?到目前为止,我所做的只是安装 Eclipse。我怎样才能成功地让 Maven 运行?

EDIT: Now I am using Java EE and still run into problems when making a Maven project. I get a "Could not resolve archetype error" could this be because I'm behind a proxy?

编辑:现在我正在使用 Java EE,但在制作 Maven 项目时仍然遇到问题。我收到“无法解决原型错误”的消息,这可能是因为我在代理后面吗?

采纳答案by GGrec

Most convenient option:

最方便的选择:

The reason you're getting that error is because that repo is deprecated, and it has been moved. Example of how the new repo looks:

您收到该错误的原因是该存储库已被弃用,并且已被移动。新仓库的外观示例:

http://download.eclipse.org/technology/m2e/releases/1.0/1.0.0.20110607-2117

http://download.eclipse.org/technology/m2e/releases/1.0/1.0.0.20110607-2117

Copy that in the Install New Softwareview, and you will see that it works.

将其复制到“安装新软件”视图中,您将看到它有效。



Other options:

其他选项:

  • Install the Maven Integration from Eclipse Marketplace(Help -> Eclipse Marketplace)
  • Eclipse Marketplace安装 Maven 集成(帮助 -> Eclipse Marketplace)
  • Download the EE version of Kepler(comes with m2e)
  • 下载Kepler EE版(m2e自带)
  • Choose your own release(bottom of the page) and use the Install New Softwareview.

  • 选择您自己的版本(页面底部)并使用“安装新软件”视图。

  • 回答by user1016950

    I had the same issue here and the above answer didnt work for me. Although Maven is installed I cane update my dependencies on my folder the way I used to be able to do on Juno. What I did was used the pom.xml from my current project and pasted it into the pom of my new project I created specifically in Eclipse using new project->Maven.

    我在这里遇到了同样的问题,上面的答案对我不起作用。尽管 Maven 已安装,但我可以像以前在 Juno 上所做的那样更新我对文件夹的依赖项。我所做的是使用当前项目中的 pom.xml 并将其粘贴到我使用新项目-> Maven 在 Eclipse 中专门创建的新项目的 pom 中。

    This was eclipse knows its a Maven project and allows my all the benefits of being one.

    这是 eclipse 知道它的一个 Maven 项目,并允许我成为一个人的所有好处。

    回答by Badr Bellaj

    To install maven properly for eclipse you should set the correct repos as follow:

    要为 Eclipse 正确安装 maven,您应该按如下方式设置正确的存储库:

    Help=>install=> then work with http://download.eclipse.org/releases/

    Help=>install=> 然后使用 http://download.eclipse.org/releases/

    example of eclipse version : mars or kepler ..

    eclipse 版本示例:mars 或 kepler ..