Skip to content

Items order in java config is important  #1417

Closed

Description

@slawekjaranowski
  • summary of problem

working example

          <configuration>
            <java>
              <palantirJavaFormat/>
              <removeUnusedImports/>
              <importOrder>
                <order>javax,java,,\#</order>
              </importOrder>
            </java>
          </configuration>

Works as I expected.

not working example

          <configuration>
            <java>
              <removeUnusedImports/>
              <importOrder>
                <order>javax,java,,\#</order>
              </importOrder>
              <palantirJavaFormat/>
            </java>
          </configuration>

As you see I change position of palantirJavaFormat and importOrder has no effect is such case

Second example is based on your documentation.

One more hint - in documentation there is \\# for static import - should be \#

Proposition for resolve

fix documentation, and add explain about items order in configuration.

  • maven version - 3.8.6
  • spotless version - 2.28.0

Activity

  1. nedtwigg commented on Dec 4, 2022

    @nedtwigg
    Member

    Agreed this is a bug in our docs, thanks for reporting.

  2. kwin commented on Dec 5, 2022

    @kwin
    Contributor

    Instead of fixing the docs would it be possible to make the implementation work irrespective of the order. Having a certain order of elements in the plugin configuration of a pom.xml is totally unexpected.

  3. nedtwigg commented on Jan 7, 2023

    @nedtwigg
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions