如何在 Eclipse 中停用 Maven 配置文件?
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,您应该能够添加 !给定配置文件的前缀,在项目中 >属性>梅文> “活动 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.
将新的(空)配置文件添加到 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.