You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No format for pom.xml in the Maven POM editor #1457
Describe the bug
There is no option to format pom.xml in the Maven POM editor.
There is no Source menu with Format option, Ctrl+Shift+F does nothing.
Context menu contains Source -> Format Ctrl+Shift+F , but selection of this command also does nothing.
Spring Tool Suite 4
Version: 4.27.0.RELEASE
Build Id: 202411281622
Revision: a0cb489
A clear and concise description of what the bug is.
To Reproduce
Open pom.xml in Maven POM editor
Use Ctrl+Shift+F to format or select from context menu Source ->Format
XML still unformatted
In the XML editor the same file is formatted without any issues.
@foal Thanks for reporting, let's see if we can get to the bottom of this. So far I failed to reproduce this, installing a fresh Spring Tools 4 for Eclipse 4.27.0, starting it with an empty new workspace, creating a Rest Service guide project, opening the pom.xml file in the POM file editor, for Format action shows up in the menu and hitting the corresponding keyboard shortcut (on my macOS machine, it is Cmd-Shift-F) seems to work just fine.
So we need to figure out what is different on your end that causes the Format action to disappear. Do you have additional plugins installed? If yes, can you try to reproduce this with a fresh Spring Tools for Eclipse installation? Another angle could be to install a plain Eclipse 2024-12 JEE package to see if that works on your machine.
(Since I can't reproduce this locally, I am trying to identify where the problem might be coming from, therefore the various checks to see where the root cause might be)
@martinlippert Thank you for your time. I have installed fresh Eclipse 2024-12 installation, installed Spring Boot Language Server Feature and after that Format does not work.
How do you invoke the formatting action? Select all/range and then Ctrl-F/Cmd-F?
I don't see the textDocument/rangeFormatting message sent to XML language server in your log file... I do see it in mine where formatting works. Can you confirm that the textDocument/rangeFormatting message is not sent from the client to the server? In other words select a range invoke the action (perhaps try invoking the action via the context menu Source -> Format as well in case the key binding got disabled somehow) and find that in the log there is not textDocument/rangeFormatting message at all.
Do you see the textDocument/rangeFormatting in the XML LS log when you invoke the format action?
If not, we should probably have a look at the Eclipse log as well... If this is the case, can you please attach the Eclipse log?
This is marked as waiting-for-feedback. What kind of feedback is still expected?
I ran into this issue as well. It is super annoying to have to rely on external tools for pom.xml formatting.
Spring Tools for Eclipse
Version: 4.32.2.RELEASE
Build Id: 202511091838
OS: Windows 11, v.10.0, x86_64 / win32
Java vendor: Eclipse Adoptium
Java runtime version: 21.0.5+11-LTS
Java version: 21.0.5
Update: nevermind, after restart of sts it works again.
Update: nevermind, after restart of sts it works again.
I am finally closing this now, based on the latest comment here. In case you (or anyone else) come across this issue again, please comment and we can re-open.
I still have the issue with this functionality - right now the format works only for selected text. To format the XML I need to select them all or at least part with is unformatted.
Unfortunately, I am still not able to reproduce this - which makes it difficult to find the root cause here. From the above comments, it reads like as soon as you install the Spring Boot Language Server Feature into a plain Eclipse JEE package, the format action is somewhat broken. Can you verify if this is still the case with a new Eclipse 2025-12 JEE install and installing the Spring Boot Language Server Feature from https://cdn.spring.io/spring-tools/release/update/latest/ ? That would be great.
In case this breaks the format action (again), what happens if you disable the association between POM Xml and the Spring Boot Language Server in the preferences via: Preferences -> Language Serversand restart the IDE?
What happens if you open the pom.xml file with Open With...in the generic code editor? Does formatting work in there?
Is there anything related showing up in the Error Log view when you open that? Anything related to XML or Lemminx maybe?
Activity
martinlippert commentedon Jan 27, 2025
@foal Thanks for reporting, let's see if we can get to the bottom of this. So far I failed to reproduce this, installing a fresh Spring Tools 4 for Eclipse 4.27.0, starting it with an empty new workspace, creating a Rest Service guide project, opening the
pom.xmlfile in the POM file editor, forFormataction shows up in the menu and hitting the corresponding keyboard shortcut (on my macOS machine, it isCmd-Shift-F) seems to work just fine.So we need to figure out what is different on your end that causes the
Formataction to disappear. Do you have additional plugins installed? If yes, can you try to reproduce this with a fresh Spring Tools for Eclipse installation? Another angle could be to install a plain Eclipse 2024-12 JEE package to see if that works on your machine.anatoly-spb commentedon Feb 4, 2025
I confirm the problem. I have did the following:
Here is my full configuration https://pastebin.com/QqMBfjBs
foal commentedon Feb 5, 2025
For 4.28 on Windows - the same issue.
BoykoAlex commentedon Feb 5, 2025
Do you have XML language server enabled?
foal commentedon Feb 5, 2025
If it is enabled by default - yes. As I said I do not change nothing, just unpack, run import project and try to format pom.xml
foal commentedon Feb 5, 2025
I have checked - yes, it is enabled
martinlippert commentedon Feb 6, 2025
@anatoly-spb @foal Can you try to reproduce this with a plain Eclipse JEE 2024-12 installation from https://www.eclipse.org/downloads/packages/
(Since I can't reproduce this locally, I am trying to identify where the problem might be coming from, therefore the various checks to see where the root cause might be)
anatoly-spb commentedon Feb 6, 2025
@martinlippert Thank you for your time. I have downloaded https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-12/R/eclipse-java-2024-12-R-win32-x86_64.zip&mirror_id=1285 and there is no problem with formatting pom, it works as expected:
foal commentedon Feb 6, 2025
@martinlippert, yes, I can confirm in eclipse-jee-2024-12-R-win32-x86_64.zip the XML formatting on pom.xml works too from the box.
5 remaining items
anatoly-spb commentedon Feb 24, 2025
@martinlippert Thank you for your time. I have installed fresh Eclipse 2024-12 installation, installed Spring Boot Language Server Feature and after that Format does not work.
BoykoAlex commentedon Feb 24, 2025
Is content assist, validation still working in the POM editor?
BoykoAlex commentedon Feb 24, 2025
Please turn on the logging for the Lemminx server (XML language server)

Have another go at formatting while the logging is on and share the log contents with us please.
anatoly-spb commentedon Feb 24, 2025
@BoykoAlex Thank you. Here is log org.eclipse.wildwebdeveloper.xml.zip
the pom.xml:
There is one thing: Pom Xml is attached to Spring Boot Language Server:
Is it ok?
Pom Xml:
Maven POM XML:
BoykoAlex commentedon Feb 24, 2025
How do you invoke the formatting action? Select all/range and then Ctrl-F/Cmd-F?
I don't see the
textDocument/rangeFormattingmessage sent to XML language server in your log file... I do see it in mine where formatting works. Can you confirm that thetextDocument/rangeFormattingmessage is not sent from the client to the server? In other words select a range invoke the action (perhaps try invoking the action via the context menu Source -> Format as well in case the key binding got disabled somehow) and find that in the log there is nottextDocument/rangeFormattingmessage at all.anatoly-spb commentedon Feb 24, 2025
@BoykoAlex I try both Ctrl+Shift+F and context menu Source/Format - nothing work.
BoykoAlex commentedon Feb 24, 2025
Do you see the
textDocument/rangeFormattingin the XML LS log when you invoke the format action?If not, we should probably have a look at the Eclipse log as well... If this is the case, can you please attach the Eclipse log?
anatoly-spb commentedon Feb 25, 2025
@BoykoAlex I see nothing with textDocument/rangeFormatting. I have attached eclipse log and others inside log.zip
log.zip
anatoly-spb commentedon Feb 25, 2025
Here is log from fresh Eclipse IDE installation. textDocument/rangeFormatting presents in .log file.
log.xml.zip
Also in fresh Eclipse IDE only one Maven POM XML content type, after installation Spring there is Pom XML:
Does it matter?
Rots commentedon Dec 9, 2025
This is marked as waiting-for-feedback. What kind of feedback is still expected?
I ran into this issue as well. It is super annoying to have to rely on external tools for pom.xml formatting.
Spring Tools for Eclipse
Version: 4.32.2.RELEASE
Build Id: 202511091838
OS: Windows 11, v.10.0, x86_64 / win32
Java vendor: Eclipse Adoptium
Java runtime version: 21.0.5+11-LTS
Java version: 21.0.5
Update: nevermind, after restart of sts it works again.
martinlippert commentedon Dec 9, 2025
I am finally closing this now, based on the latest comment here. In case you (or anyone else) come across this issue again, please comment and we can re-open.
foal commentedon Dec 9, 2025
I still have the issue with this functionality - right now the format works only for selected text. To format the XML I need to select them all or at least part with is unformatted.
martinlippert commentedon Dec 12, 2025
Unfortunately, I am still not able to reproduce this - which makes it difficult to find the root cause here. From the above comments, it reads like as soon as you install the
Spring Boot Language Server Featureinto a plain Eclipse JEE package, the format action is somewhat broken. Can you verify if this is still the case with a new Eclipse 2025-12 JEE install and installing theSpring Boot Language Server Featurefrom https://cdn.spring.io/spring-tools/release/update/latest/ ? That would be great.In case this breaks the format action (again), what happens if you disable the association between
POM Xmland theSpring Boot Language Serverin the preferences via:Preferences -> Language Serversand restart the IDE?What happens if you open the
pom.xmlfile withOpen With...in the generic code editor? Does formatting work in there?Is there anything related showing up in the
Error Logview when you open that? Anything related toXMLorLemminxmaybe?