将maven项目集成到Eclipse中
我有一个用于验证的 Maven 模块,我必须将其传递给旧版本的 Eclipse,其中包含 Jrules API。但是这个 Eclipse IDE 没有 Maven 插件。所以我想我应该在模块上执行 maven:install 并移动创建的 jar。 但是,当我尝试导入->现有项目到工作区->选择存档文件时: 并将其指向 jar 没有出现任何项目。我不知道如何将我的 Maven 模块移动到过时的 Eclipse,而不必获取项目所需的 101 个 jar 并且不将其进行 mavenise... 当然,他们必须是一个简单的方法,否则行家将是整体的
I have a maven module for validation which I must pass to a old version of Eclipse which has the Jrules API within. However there is not a maven plugin for this eclipse IDE. So I figured I would do a maven:install on the module and move over the created jar.
However when I try to import->Existing Projects into Workspace->Select archive file:
and point it to the jar no projects appear. I'm at a loss as to how I can move my maven module to the outdated eclipse, without having to grab the 101 jars required for the project and non mavenise it...
Surely their has to be an easy way to this or is maven will monolithic
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 maven-eclipse-plugin 生成 .project 并.classpath 文件:
这将创建 IDE 元数据文件,该文件引用本地 Maven 存储库文件夹中的项目所依赖的所有 JAR。
尝试使用“导入->现有项目到工作空间->选择存档文件”将 Maven 构建过程构建的 JAR 导入到 Eclipse 中不起作用,因为 Eclipse 期望找到一个 .zip/.jar 文件.project 元数据文件和源代码。您编译的 JAR 可能两者都不包含。
Use the maven-eclipse-plugin to generate the .project and .classpath files for you:
This will create the IDE metadata files which reference all of the JARs your project depends on from within your local maven repository folder.
Attempting to import the JAR that is built by the Maven build process into Eclipse using the " import->Existing Projects into Workspace->Select archive file" doesn't work because Eclipse expects to find a .zip/.jar file with the .project metadata files and the source code. Your compiled JAR likely contains neither.
我建议使用 M2Eclipse maven 插件。右键单击项目->启用依赖管理 ->更新项目配置
我广泛使用了 eclipse:eclipse,我的经验是 M2Eclipse 不仅得到更好的支持,而且整体工作得更好。
I would recommend using the M2Eclipse maven plugin. Right click the project -> Enable Dependency Management -> Update Project Configuration
I have used eclipse:eclipse extensively and my experience is that M2Eclipse is not only better supported but works better overall.