将maven项目导入eclipse [英] Importing maven project into eclipse

查看:116
本文介绍了将maven项目导入eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将现有的maven项目导入eclipse。我发现有两种方法:



1)通过从命令行运行 mvn eclipse:eclipse

2)从eclipse安装maven eclipse插件。/ b

两者之间有什么区别,哪个更好?



如果我通过eclipse菜单安装maven eclipse插件帮助 - >安装新软件,是否仍然需要修改我的pom.xml以在插件部分包含maven eclipse插件?

解决方案


我想将现有的maven项目导入eclipse。我发现有两种做法,一种是通过从命令行运行 mvn eclipse:eclipse ,另一种是从eclipse安装maven eclipse插件。两者之间有什么区别,哪一个更好?


maven-eclipse-plugin 是一个 Maven插件,并且总是 Maven 1中的第一个插件之一,第一个插件迁移到Maven 2之一。在很长一段时间内,唯一可行的方法就是将整合导入一个现有的maven项目与Eclipse。实际上,它不提供真正的集成,它只生成 .project .classpath 文件(它也有WTP支持)。我在年份中使用了这个插件,并且非常满意(这时候,非常不满意的Eclipse插件为Maven,如 m2eclipse的)。



m2eclipse 插件是用于Maven的 Eclipse插件之一 。它实际上是第一个也是最成熟的项目,旨在将Maven集成到Eclipse IDE中(这并不总是如此,在2年前并没有真正使用,请参阅 Mevenide vs. M2Eclipse,Q for Eclipse / IAM )。但是,即使我不使用从Eclipse或POM编辑器或其他奇特的向导创建Maven项目,我不得不说这个插件现在完全可用,提供非常顺利的集成,有很好的功能...在其他话题,我终于切换到了:)我现在推荐给任何用户(高级或初学者)。


如果我安装maven eclipse插件通过eclipse菜单帮助 - >安装新软件,我仍然需要修改我的pom.xml以在插件部分包含maven eclipse插件?


这个问题有点混乱,但答案是否定的。安装了m2eclipse插件后,只需右键单击程序包资源管理器和导入...> Maven项目,将现有的maven项目导入到Eclipse中。


I want to import existing maven project into eclipse. I found 2 ways to do it:

1) Through running from command line mvn eclipse:eclipse
2) Twoo install maven eclipse plugin from eclipse.

What is the difference between the both and which one is preferable?

If I install maven eclipse plugin through the eclipse menu Help -> Install New Software, do I still need to modify my pom.xml to include the maven eclipse plugin in the plugins section?

解决方案

I want to import existing maven project into eclipse. I found 2 ways to do it, one is through running from command line mvn eclipse:eclipse and another is to install maven eclipse plugin from eclipse. What is the difference between the both and which one is preferable?

The maven-eclipse-plugin is a Maven plugin and has always been there (one of the first plugin available with Maven 1, one of the first plugin migrated to Maven 2). It has been during a long time the only decent way to integrateimport an existing maven project with Eclipse. Actually, it doesn't provide real integration, it just generates the .project and .classpath files (it has also WTP support) from a Maven project. I've used this plugin during years and was very happy with it (and very unsatisfied at this time by Eclipse plugins for Maven like m2eclipse).

The m2eclipse plugin is one of the Eclipse plugins for Maven. It's actually the first and most mature of the projects aimed at integrating Maven within the Eclipse IDE (this has not always been the case, it was not really usable ~2 years ago, see the feedback in Mevenide vs. M2Eclipse, Q for Eclipse/IAM). But, even if I do not use things like creating a Maven project from Eclipse or the POM editor or other fancy wizards, I have to say that this plugin is now totally usable, provides very smooth integration, has nice features... In other words, I finally switched to it :) I'd now recommend it to any user (advanced or beginners).

If I install maven eclipse plugin through the eclipse menu Help -> Install New Software, do I still need to modify my pom.xml to include the maven eclipse plugin in the plugins section?

This question is a bit confusing but the answer is no. With the m2eclipse plugin installed, just right-click the package explorer and Import... > Maven projects to import an existing maven project into Eclipse.

这篇关于将maven项目导入eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆