Bind to maven phase is not working
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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/flink-agents#1152 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo-graphs#75 ·