Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No format for pom.xml in the Maven POM editor #1457

Open
foal opened this issue Jan 26, 2025 · 10 comments
Open

No format for pom.xml in the Maven POM editor #1457

foal opened this issue Jan 26, 2025 · 10 comments
Labels
for: eclipse something that is specific for Eclipse status: waiting-for-feedback type: bug

Comments

@foal
Copy link

foal commented Jan 26, 2025

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

  1. Open pom.xml in Maven POM editor
  2. Use Ctrl+Shift+F to format or select from context menu Source ->Format
  3. XML still unformatted

In the XML editor the same file is formatted without any issues.

@martinlippert
Copy link
Member

@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.

@anatoly-spb
Copy link

anatoly-spb commented Feb 4, 2025

I confirm the problem. I have did the following:

  1. download fresh Spring Tool Suite 4.27 for Windows x86_64 from https://spring.io/tools:
Spring Tool Suite 4 

Version: 4.27.0.RELEASE
Build Id: 202411281622
Revision: a0cb489d5daf268d32d7327495fe28f3d12212b3
  1. create fresh workspace with default options
  2. create maven project with simple project template
  3. unformat pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>test</name>
<description>test</description>
</project>
  1. press Ctrl+Shift+F and source/format and my pom in Maven POM Editor is still unchanged, is still unformatted

Here is my full configuration https://pastebin.com/QqMBfjBs

@foal
Copy link
Author

foal commented Feb 5, 2025

For 4.28 on Windows - the same issue.

  1. Download
  2. Unpack
  3. Run as is without any changes with workspace in new folder
  4. Import Maven project
  5. Try to format pom.xml with: Ctrl+Shift+F - no works, context menu on editor - no works, context menu in Package explorer - no works

@BoykoAlex
Copy link
Contributor

Do you have XML language server enabled?

@foal
Copy link
Author

foal commented 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
Copy link
Author

foal commented Feb 5, 2025

I have checked - yes, it is enabled

Image

@martinlippert
Copy link
Member

@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
Copy link

anatoly-spb commented 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:

  1. download fresh eclipse for java developers
  2. create fresh workspace
  3. create simple maven project
  4. open pom with Maven POM Editor
  5. unformat pom.xml
  6. Ctrl+Shift+F formats my pom as expected

@foal
Copy link
Author

foal commented 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.

@anatoly-spb
Copy link

anatoly-spb commented Feb 6, 2025

I try to compare Spring Tool Suite 4.28.0.RELEASE with eclipse-jee-2024-12-R-win32-x86_64.zip. There are several remarks:

  1. Eclipse JEE uses Temurin-21.0.5+11, STD uses Temurin-21.0.6+7
  2. I start STS and Eclipse JEE with the -consoleLog -debug command line options. When open pom.xml in Eclipse JEE there are messages from org.eclipse.wildwebdeveloper.xml in console log:
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\stranger'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:10.981
!MESSAGE The given URI https://jakarta.ee/xml/ns/jakartaee/application-client_9.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:10.984
!MESSAGE The given URI https://jakarta.ee/xml/ns/jakartaee/jobXML_2_0.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:10.987
!MESSAGE The given URI https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:10.991
!MESSAGE The given URI https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:11.004
!MESSAGE The given URI https://jakarta.ee/xml/ns/validation/validation-configuration-3.0.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

!ENTRY org.eclipse.wildwebdeveloper.xml 2 0 2025-02-06 11:52:11.010
!MESSAGE The given URI http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_1.xsd from org.eclipse.jst.standard.schemas could not be resolved for local access

STS outputs only the following without messages from org.eclipse.wildwebdeveloper.xml:

!ENTRY org.eclipse.egit.ui 2 0 2025-02-06 11:47:21.608
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\stranger'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.jface 2 0 2025-02-06 11:53:00.735
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2025-02-06 11:53:00.736
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
        ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
                Open a type in a Java editor,
                Category(org.eclipse.ui.category.navigate,Navigate,null,true),
                WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.navigate.open.type"),
                ,,true),null),
        org.eclipse.ui.defaultAcceleratorConfiguration,
        org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
        ParameterizedCommand(Command(org.eclipse.lsp4e.symbolInWorkspace,Go to Symbol in Workspace,
                ,
                Category(org.eclipse.lsp4e.category,Language Servers,null,true),
                WorkbenchHandlerServiceHandler("org.eclipse.lsp4e.symbolInWorkspace"),
                ,,true),null),
        org.eclipse.ui.defaultAcceleratorConfiguration,
        org.eclipse.ui.contexts.window,,,system)

May be it will be helpfull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse status: waiting-for-feedback type: bug
Projects
None yet
Development

No branches or pull requests

4 participants