RemoveUnusedImports does not work
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- build-system
Research direction
Start by reproducing the reported Maven setup with spotless-maven-plugin 2.44.4 on Maven 3.9.9 and JDK 21, focusing on the Java removeUnusedImports step. Check whether the run completes without removing the unused imports, and use that result to identify the relevant Maven plugin entry point or test; done means the reported unused imports are removed.
Written by the indexing model from the issue text.
Description
Not sure this is related to https://github.com/diffplug/spotless/issues/1819#issuecomment-2830878265, so opening a new issue here.
The removeUnusedImports is not working, with the setup
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.44.4</version>
<configuration>
<java>
<palantirJavaFormat>
<version>2.63.0</version>
<style>PALANTIR</style>
<formatJavadoc>true</formatJavadoc>
</palantirJavaFormat>
<removeUnusedImports/>
<importOrder/>
<formatAnnotations/>
</java>
</configuration>
</plugin>
on Maven 3.9.9 and JDK 21.
There is no error in the console but unused imports are not removed at the end of the run.
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cryptomator/hub#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·