i used a cdata section enclosing the text i wanted to keep as is (prevent formatting). for example:


then under window -> preferences -> xml -> xml files -> editor i selected the preserve whitespace in tags with pcdata content.

this worked for me.


unfortunately there seems to be no way to disable the xml formatter for some part of the code (as it is possible with java code).

you can - however - increase the maximum length of lines that the xml formatter adheres to:

window -> preferences -> xml files -> editor

set the "line width" to whatever value you want. i have set mine to "999". now it does not break lines that are too long. but of course now i have myself to make those lines short enough so that it keeps being readable.


you can select part of the pom which you want to format and press

ctrl + shift + f

when you press 'ctrl + shift + f' without selection it will format entire file.
with selection will format only selected part.

Related Query

More Query from same tag