自动格式化 pom.xml 而不使用 m2eclipse 插件
我在 Eclipse 中开发时不使用 Eclipse maven 插件。
我使用以下命令在外部生成 Eclipse 类路径:
mvn eclipse:eclipse
这已经运行良好一段时间了,我不倾向于添加 Maven 插件。
但是,我希望能够“自动格式化”我的 pom.xml 文件。
我的 pom.xml 没有显示为“源”文件,因此上下文“源”菜单没有显示。
Control-Shift-F 也不起作用。
有没有办法在不安装 m2eclipse 插件的情况下做到这一点?是否有其他通用的“XML 编辑器”插件可以帮助解决此问题?
I don't use the Eclipse maven plugin while developing in Eclipse.
I generate my Eclipse classpath externally using the following command:
mvn eclipse:eclipse
This has worked fine for quite some time and I am not inclined to add a maven plugin.
However, I would like to be able to "autoformat" my pom.xml file.
My pom.xml is not showing up as a "Source" file and therefore the contextual "Source" menu doesn't show up.
Control-Shift-F doesn't work either.
Is there a way to do this without installing the m2eclipse plugin? Is there any other generic "XML Editor" plugin that can help with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
仅当我们在文本编辑器中打开时才会出现此问题。当我们在 xml 编辑器中打开 pom.xml 并使用快捷键 shft+ctl+F 时,解决方案有效
This problem occurs only when we open in text editor. Solution works when we open the pom.xml in xml editor and use the short cut commands as shft+ctl+F
同时使用 ctrl + shift + F 键,对我来说,笔记本电脑的 ctrl + shift 组合键左侧不起作用,我尝试使用右侧组合键,但它有效。
Use
ctrl + shift + F
keys together, for me left side ofctrl + shift
key combination of laptop did't work I tried with right side combination and it worked.所以,我找到了一种方法 -
完成了! :)
So, I found a way -
it's Done!! :)
我可能遗漏了一些明显的东西,但为什么不使用 Eclipse 的内置 XML 编辑器 它支持格式化(通过常规 Shift+Ctrl +F)?
I may be missing something obvious but why don't you use Eclipse's built-in XML Editor which supports formatting (via the regular Shift+Ctrl+F)?