我可以使用命令行将Eclipse Project转换为Maven吗? [英] Can I convert Eclipse Project to maven using command line?

查看:144
本文介绍了我可以使用命令行将Eclipse Project转换为Maven吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是,我必须在不允许任何其他插件的Eclipse版本中工作,因此,无法选择安装maven.

The issue I have is that I have to work in an Eclipse version that doesn't allow any additional Plugins and hence, installing maven is not an option.

但是,我想知道我是否仍然可以使用命令行来创建我的maven项目.

However, I am wondering whether I can still use command line to create my maven project.

如果我从命令行创建一个maven项目,则Eclipse-> File-> Import无法正常工作. 我试图在Eclipse项目文件夹中创建我的Maven项目,并且在原始Eclipse项目中获得了Maven文件夹结构. 我使用eclipse IDE重命名了src文件夹,并将其称为Maven创建的结构"src".造成混乱的原因是我无法创建软件包,而无法创建这些文件夹.

If I create a maven project from command line, Eclipse -> File -> Import didn't work. I tried to create my maven project inside eclipse project folders and I got a maven folder structure inside my original eclipse project. Using the eclipse IDE I renamed the src folder and instead called the Maven created structure 'src'. That created a mess because I cannot create packages instead these folders.

最好的问候,

推荐答案

M2e插件Eclipse 强烈建议在Eclipse中的Maven项目上工作.
如果您有网络限制,无法通过经典的Eclipse插件安装进行安装,则仍可以通过构建源代码来安装它插件.

The M2e plugin Eclipse is strongly recommended to work on a Maven project in Eclipse.
If you have network constraints to install it from classic Eclipse plugin installation, you may still install it by building the source code of the plugin.

或者,您可以使用 Apache Maven Eclipse插件它仅依赖于Maven而不是Eclipse.使用它可以根据pom依赖项生成Eclipse类路径.
特别是:mvn eclipse:eclipse会生成Eclipse配置文件.

As an alternative, you could use the Apache Maven Eclipse Plugin that relies on Maven only and not Eclipse. Using it allows to generate Eclipse classpath according to the pom dependencies.
Particularly : mvn eclipse:eclipse that generates the Eclipse configuration files.

Maven Eclipse插件用于生成Eclipse IDE文件 (* .classpath,*.project,*.wtpmodules和.settings文件夹)用于 与项目一起使用.

The Maven Eclipse Plugin is used to generate Eclipse IDE files (*.classpath, *.project, *.wtpmodules and the .settings folder) for use with a project.

但是它已被弃用,不再维护. 所以我不推荐它.

But it is deprecated and is not maintained any longer. So I cannot recommend it.

免责声明:建议用户使用Eclipse Maven m2e 集成而不是此插件,因为它可以更类似于 项目中描述的实际构建和运行时类路径 pom.xml-其他优点.但是,有项目设置 和静态工作流程仍然可以更有效地工作 生成的Eclipse元数据-例如,当存在大量元数据时 反应堆中的项目数量.那就是Maven Eclipse插件可以在哪里 仍然可以帮助您.

Disclaimer: Users are advised to use m2e, the Eclipse Maven Integration instead of this plugin, as it can more closely resemble the actual build and runtime classpaths as described in the project pom.xml - among other advantages. However, there are project setups and workflows that still work more efficiently with statically generated Eclipse metadata - for example when there is a large number of projects in a reactor. That's where the Maven Eclipse Plugin can still help you.

这篇关于我可以使用命令行将Eclipse Project转换为Maven吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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