Skip to content

Maven plugin incompatible with 3.3.9 #391

@phillipuniverse

Description

@phillipuniverse

Summary of problem

Using the Spotless plugin in a Maven project and applying with Maven 3.3.9 throws an exception when I mvn spotless:check.

It looks like this is only in 1.21.1, this was fine in 1.20.0.

  • Gradle or maven version - Maven 3.3.9
  • spotless version - 1.21.1
  • operating system and version - Macos 10.14.3
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
<plugin>
    <groupId>com.diffplug.spotless</groupId>
    <artifactId>spotless-maven-plugin</artifactId>
    <version>1.21.1</version>
    <executions>
        <execution>
            <id>check</id>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <java>
            <eclipse>
                <version>4.10.0</version>
                <file>path/to/eclipse-formatter.xml</file>
            </eclipse>
            <importOrder>
                <file>path/to/java.importorder</file>
            </importOrder>
            <removeUnusedImports />
        </java>
        <formats>
            <format>
                <!-- XML files -->
                <includes>
                    <include>src/main/**/*.xml</include>
                    <include>**/pom.xml</include>
                </includes>
                <excludes>
                    <exclude>src/main/resources/rebel-remote.xml</exclude>
                    <exclude>src/main/resources/rebel.xml</exclude>
                    <exclude>**/target/**/pom.xml</exclude>
                </excludes>
                <indent>
                    <spaces>true</spaces>
                    <spacesPerTab>4</spacesPerTab>
                </indent>
                <trimTrailingWhitespace />
            </format>
            <format>
                <includes>
                    <!-- YAML -->
                    <include>src/main/**/*.yml</include>
                    <include>src/main/**/*.yaml</include>
                    <!-- JS within Java projects -->
                    <include>src/main/**/*.js</include>
                    <!-- SQL imports -->
                    <include>src/main/**/*.sql</include>
                </includes>
                <indent>
                    <spaces>true</spaces>
                    <spacesPerTab>2</spacesPerTab>
                </indent>
                <trimTrailingWhitespace />
            </format>
        </formats>
    </configuration>
</plugin>
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace

https://gist.github.com/phillipuniverse/db14a796ffb4e8392da89c790537fd02

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions