如何在 Eclipse 中停用 Maven 配置文件?

发布于 2024-12-17 08:30:07 字数 164 浏览 1 评论 0原文

我在 eclipse Indigo 中有一个 Maven 项目。该项目的 POM 默认使用某个配置文件,我希望从 Eclipse 中禁用该配置文件。我知道我可以通过右键单击项目 --> 属性 --> Maven --> 活动 Maven 配置文件来激活。

但如何禁用该配置文件呢?

I have a maven project in eclipse Indigo. The project's POM uses a certain profile by default, which I wish to disable from my eclipse. I know I can activate through right-click on project-->properties-->Maven-->Active Maven Profiles.

But how do I disable that profile?

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

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

发布评论

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

评论(2

聚集的泪 2024-12-24 08:30:07

通常,您应该能够添加 !给定配置文件的前缀,在项目中 >属性>梅文> “活动 Maven 配置文件”字段。但是,m2e 中存在一个错误,它会阻止配置文件被显式停用: https:// bugs.eclipse.org/bugs/show_bug.cgi?id=337353

抱歉,这并不能解决您的问题,但您至少现在可以跟踪解决进度错误的。如果您喜欢生活在边缘,您可以克隆 m2e 的 git 存储库,应用修复补丁并从源代码构建 m2e。

Normally, you should be able to add a ! prefix to the given profile, in the project > Properties > Maven > "Active Maven Profiles" field. But, there's a bug in m2e that prevent profiles to be explicitely deactivated : https://bugs.eclipse.org/bugs/show_bug.cgi?id=337353

Sorry this doesn't constitute a solution to your issue, but you can at least now track progress on the resolution of the bug. And if you like living on the edge, you can clone m2e's git repo, apply the fix patch and build m2e from source.

鸩远一方 2024-12-24 08:30:07

将新的(空)配置文件添加到 POM(例如“eclipse”)并将其设置为 Eclipse 中的活动 Maven 配置文件。

Add a new (empty) profile to your POM (e.g. 'eclipse') and set this as the active maven profile in your eclipse.

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