Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bind to maven phase is not working

Open
#2,112 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with the linked reproduction repository and its Maven configuration, then run mvn verify after introducing the described indentation error. Compare the configured validate and verify executions with the expected failure and the observed formatting, and consider the issue addressed when verify runs the goals in the intended order without applying changes unexpectedly.

Written by the indexing model from the issue text.

Description

bug-unconfirmed

If you are submitting a bug, please include the following:

Summary:
Applying the spotless maven plugin to specific phases is not working. For example, having binded check to validate phase and apply to verify, running verify also applies spotless.
Plugin goals run correctly individually eg mvn spotless:check

public git repo with example: https://gitlab.com/thahgr/spotless-maven-phases-test

to reproduce

  • modify a file adding an incorrect identation (eg new line)
  • run mvn verify

expected: the command should fail because spotless check failed
actual: the command succeeds while writing files with spotless::apply

versions:
maven: 3.8.1
java: 17
spotless: 2.43.0
google-java-plugin: 1.22.0
os: Ubuntu 22.04.4 LTS

Spotless configuration

<configuration>
    <java>
        <importOrder/>
        <removeUnusedImports/>
        <googleJavaFormat>
            <version>${google.java.format.version}</version>
            <style>GOOGLE</style>
            <reflowLongStrings>true</reflowLongStrings>
        </googleJavaFormat>
    </java>
    <lineEndings>UNIX</lineEndings>
</configuration>
<executions>
    <execution>
        <id>spotless-check</id>
        <goals>
            <goal>check</goal>
        </goals>
        <phase>verify</phase>
    </execution>
    <execution>
        <id>spotless-apply</id>
        <goals>
            <goal>apply</goal>
        </goals>
        <phase>validate</phase>
    </execution>
</executions>
Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.