使用 Eclipse 的 Maven 2.0 集成时如何禁用 Maven 构建?

发布于 2024-09-01 23:53:01 字数 487 浏览 3 评论 0原文

如何阻止“Maven 2.0 集成”插件运行 Maven 构建,同时保持选中“自动构建”?

我很确定之前它曾经是一些禁用maven构建的复选框,但是在升级Ubuntu之后; eclipse似乎在这个过程中已经更新了,现在我找不到任何方法来关闭maven构建。 Maven 构建实际上需要几分钟(大约 5 分钟左右),而仅运行 java 构建通常只需几秒钟即可完成。

是不再可能禁用它还是他们只是将其隐藏得很好?

如果不可能,eclipse是否能够在没有插件的情况下编译我的maven项目?

(尝试用谷歌搜索解决方案,最后我得到的答案是 这篇旧文章,其中答案基本上是“您应该能够在项目首选项中禁用 Maven 构建器...”,这并没有真正帮助,因为我在那里找不到任何开/关设置)

How do I stop the "Maven 2.0 integration" plugin from running maven build, while keeping "build automatically" checked?

I'm pretty sure it used to be some check box to disable maven build before, but after upgrading Ubuntu; eclipse seems to have been updated in the process, and now I cannot find any way to turn off the maven build. The maven build takes literally minutes (about 5 minutes or so), while just running java build used to finish in seconds.

Is it no longer possible to disable it or have they just hidden it well?

If it's not possible, will eclipse be able to compile my maven project without the plugin?

(Trying to google for a solution the closes I got to an answer was several archives of this old post where the answer essentially were "You should be able to disable Maven builder in project preferences..." which doesn't really help because I cannot find any on/off settings there)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最单纯的乌龟 2024-09-08 23:53:01

要禁用 Maven 项目生成器,请右键单击您的项目,然后首选项> Builders并取消选中Maven Project Builder(您无法修改默认的maven构建器)。

替代文本 http://www.imagebanana.com/img/fikqaidv/screenshot_010.png< /a>

如果这删除了“太多”的东西,您也许可以创建自己的自定义 Maven 构建器。单击新建,选择Maven Build并根据需要进行配置。

替代文本 http://www.imagebanana.com/img/rwkmm7jb/screenshot_010.png< /a>


禁用它似乎会阻止 Eclipse 了解导致 java 构建失败的相关项目。是否有某种虚拟的、无操作的目标可以用于自动构建目标?

我想您必须在项目引用中添加相关项目(或取消选中解决工作区项目的依赖关系)。

有没有办法同时对工作区中的所有 6 个相关项目禁用它?

我不这么认为。


最后,所有这些调整看起来都像是丑陋的黑客行为。如果您对 m2eclipse 插件不满意,也许您应该使用 maven-eclipse-plugin (即运行 mvn eclipse:eclipse)来生成 .project.classpath 文件,并将项目作为现有项目导入到 Eclipse 中。

To disable the Maven Project Builder, right-click on your project then Preferences > Builders and uncheck the Maven Project Builder (you cannot modify the default maven builder).

alt text http://www.imagebanana.com/img/fikqaidv/screenshot_010.png

If this removes "too much" things, you can maybe create your own custom Maven builder. Click New, select Maven Build and configure it as you want.

alt text http://www.imagebanana.com/img/rwkmm7jb/screenshot_010.png


Disabling it seems to stop eclipse from knowing about the related projects causing the java build to fail. Is there a some sort of dummy, no-operation goal I can use for auto build goals?

I guess you would have to add the related projects in the Project References (or to uncheck Resolve dependencies from Workspace projects).

Is there a way to disable it for all 6 related projects in the workspace simultaneously?

I don't think so.


At the end, all this tweaks looks like ugly hacks. If you're not satisfied by the m2eclipse plugin, maybe you should use the maven-eclipse-plugin instead (i.e. run mvn eclipse:eclipse) instead to generate the .project and .classpath files and import your projects as Existing Project into Eclipse.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文