Search code examples
eclipsemaven-2code-formattingm2eclipsepom.xml

Autoformat pom.xml without using m2eclipse plugin


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?


Solution

  • 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)?