Skip to content

Maven plugin not working with newest Eclipse (4.38) #2835

@klafbang

Description

@klafbang

Using this works

                    <java>
                        <eclipse>
                            <version>4.37</version>
                            <file>${project.parentdir}/format.xml</file>
                        </eclipse>

but this does not

                    <java>
                        <eclipse>
                            <version>4.38</version>
                            <file>${project.parentdir}/format.xml</file>
                        </eclipse>

Eclipse 4.38 is the 25.12 release and has been out for a bit.

Image

Support for this version is especially important since that's the first to support Java 25. With 4.37, I keep getting this error:

[WARNING] Issue parsing some source. 1 problems. First problem: (line 76,col 49) '_' is a reserved keyword.
[WARNING] Not able to parse path='michael/java/pkpi/backend/src/main/java/nl/zin/riga/convert/StandardDtoConverter.java' with com.github.javaparser.JavaParser@103881db
[INFO] We mark path='michael/java/pkpi/backend/src/main/java/nl/zin/riga/convert/StandardDtoConverter.java' as not parseable by any mutator

mening, Spotless is useless for code using the Java 25 _ anonymous variable. I know I can switch to another formatter, but I've got everything set up with the Eclipse formatter and don't want to change formats.

When trying with Eclipse 4.38, I get

[INFO] --- spotless:3.2.0:apply (default-cli) @ parent ---
/ERROR WHILE PARSING BELOW
<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Eclipse 4.38 release' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1'>
  <properties size='3'>
    <property name='p2.atomic.composite.loading' value='true'/>
    <property name='p2.timestamp' value='1756495462348'/>
    <property name='p2.compressed' value='true'/>
  </properties>
</repository>

\ERROR WHILE PARSING ABOVE
...
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:3.2.0:apply (default-cli) on project parent: Execution default-cli of goal com.diffplug.spotless:spotless-maven-plugin:3.2.0:apply failed: java.io.IOException: Failed to load eclipse jdt formatter: java.lang.NullPointerException: Cannot invoke "org.w3c.dom.Node.getChildNodes()" because "childrenNode" is null -> [Help 1]

I've had the same issue with Spotless maven 3.0.0, 3.1.0, and now 3.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions