m2eclipse:导入maven项目时如何设置Eclipse项目设置?

发布于 2024-10-09 14:02:59 字数 1318 浏览 0 评论 0原文

使用 m2eclipse Eclipse 插件,开发团队中的每个人都应该能够签出源代码,在 Eclipse 中导入 Maven 项目,并一切顺利

我看到 m2eclipse 正在合并到 Eclipse 3.7 中,maven-eclipse-plugin 将不再维护,所以我正在寻找基于 m2eclipse 的解决方案(在项目导入之前不运行“mvn eclipse:clean eclipse:eclipse” ,这就是 maven-eclipse-plugin 的作用)。

maven-eclipse-plugin 允许在 pom.xml 中执行此操作

<additionalConfig>
<file>
    <name>.settings/com.google.gdt.eclipse.core.prefs</name>
    <content><![CDATA[
        eclipse.preferences.version=2
        jarsExcludedFromWebInfLib=
        warSrcDir=${project.build.directory}/${project.build.finalName}
        warSrcDirIsOutput=true
        ]]>
    </content>
</file>

更普遍的问题是 m2eclipse 如何做类似的事情? 对于某些情况,只需保存 eclipse .settings/prefs 文件即可(例如 org.eclipse.jdt.ui.prefs),但在这种情况下,com.google.gdt.eclipse.core.prefs 始终在 m2eclipse 项目导入时被覆盖。

此处提出了一个具体问题,没有回复。 谢谢!

更新:现在不可能,请参阅请求

Using m2eclipse Eclipse plugin, everybody on the dev team should be able to checkout source code, import Maven project in Eclipse and be good to go.

I saw m2eclipse is being merged into Eclipse 3.7, and maven-eclipse-plugin won't be maintained any longer, so I'm looking for a m2eclipse-based solution (without running "mvn eclipse:clean eclipse:eclipse" before project import, which is what maven-eclipse-plugin does).

maven-eclipse-plugin allows this in pom.xml

<additionalConfig>
<file>
    <name>.settings/com.google.gdt.eclipse.core.prefs</name>
    <content><![CDATA[
        eclipse.preferences.version=2
        jarsExcludedFromWebInfLib=
        warSrcDir=${project.build.directory}/${project.build.finalName}
        warSrcDirIsOutput=true
        ]]>
    </content>
</file>

The more general question is How would m2eclipse do something similar?
For some cases, just saving the eclipse .settings/prefs file works (e.g. org.eclipse.jdt.ui.prefs), but in this case, com.google.gdt.eclipse.core.prefs is always overwritten on m2eclipse project import.

A specific question is asked here, with no reply.
Thanks!

UPDATE: Not possible now, see request

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

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

发布评论

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

评论(2

眼中杀气 2024-10-16 14:02:59

我可以通过pom.xml配置m2eclipse吗?中有这个主题的答案:完全自动化的配置只能通过项目配置器。但即使对于 Google Eclipse 插件 GEP,也有一个基于 AntRun 和 XMLTask 的解决方案。结帐后只需手动触发一次。

There are answers to this topic in Can I Configure m2eclipse through pom.xml?: Completely automatic configuration can only be achieved with a ProjectConfigurator. But there is a solution based on AntRun and XMLTask even for the Google Eclipse Plugin GEP. It needs manual triggering only once after checkout.

旧街凉风 2024-10-16 14:02:59

尝试在 eclipse.org 上的 m2eclipse 论坛上提问。通过这种方式,您可能会接触到更多熟悉 m2eclipse 的人。

http://www.eclipse.org/forums/index.php ?t=线程&frm_id=61

Try asking your question on m2eclipse forum on eclipse.org. You will likely reach far more people familiar with m2eclipse that way.

http://www.eclipse.org/forums/index.php?t=thread&frm_id=61

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