views:

35

answers:

1

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?

+1  A: 

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

Pascal Thivent
It doesn't work for me. I mentioned that in the question. Will highlight it.
hashable
Ctrl-Shift-F appears to work only for "Source" files. Since the pom.xml is not a source file, it doesn't work for it.
hashable
@hashable It definitely works for me with **any** XML file when I open them with the **XML Editor** which is part of [Eclipse for Java](http://www.eclipse.org/downloads/moreinfo/java.php) (**right-click** on an XML file then **Open With > XML Editor**). If you don't have it, install it (I think it's part of Eclipse WTP).
Pascal Thivent
Sorry. It works with XML Editor. My eclipse was opening it with the standard text editor for some weird reason. Thanks.
hashable