Plugin prefix resolution regression in 3.9.12
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 40m
- Merged PRs (30d)
- 275
Description
### Affected version
3.9.12
### Bug description
Plugin prefix resolution for spotless-maven-plugin fails with 3.9.12 but works on 3.9.11 and below. It resolves `spotless` as the avro plugin instead of the spotless plugin. Example:
```
➜ mvn spotless:apply
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.100 s
[INFO] Finished at: 2025-12-22T10:28:23+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'apply' in plugin org.apache.avro:avro-maven-plugin:1.11.0 among available goals help, idl-protocol, induce, protocol, schema -> [Help 1]
```
In 3.9.11 and below we get the correct behaviour:
```
➜ mvn spotless:apply
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< org.example:plugin-maven >----------------------
[INFO] Building plugin-maven 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- spotless:3.1.0:apply (default-cli) @ plugin-maven ---
[INFO] Spotless.Java is keeping 2 files clean - 0 were changed to be clean, 0 were already clean, 2 were skipped because caching determined they were already clean
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.295 s
[INFO] Finished at: 2025-12-22T10:30:23+01:00
[INFO] ------------------------------------------------------------------------
````
This happens when using the pom.xml below:
```
4.0.0
org.springframework.boot
spring-boot-starter-parent
4.0.1
org.example
plugin-maven
0.0.1-SNAPSHOT
plugin-maven
plugin-maven
21
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-maven-plugin
org.apache.avro
avro-maven-plugin
1.11.0
generate-sources
schema
protocol
idl-protocol
PRIVATE
String
true
target/generated-sources/avro
target/generated-test-sources/avro
com.diffplug.spotless
spotless-maven-plugin
3.1.0
1.17.0
AOSP
check
```
and this settings.xml:
```
nexus
http://our.internal.nexus.host.se/content/groups/public
*
```
When used without settings.xml or a settings.xml without mirror-configuration, the prefix resolution works as before.
Contributor guide
Assessment
This issue has not been assessed yet.