Maven can't locate this plugin due to "org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'spotless'"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system
Research direction
Start by reproducing mvn -s settings.xml spotless:check with the plugin configuration and compare it with the working fully qualified goal. Inspect how com.diffplug.spotless:spotless-maven-plugin is published and whether the group-level Maven metadata is generated. Done means the spotless prefix resolves and the check goal runs successfully.
Written by the indexing model from the issue text.
Description
When try to run "mvn -s settings.xml spotless:check", it can't locate this plugin due to "org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'spotless'"
I even entered the plugin group info in settings.xml:
<pluginGroups>
<pluginGroup>com.diffplug.spotless</pluginGroup>
</pluginGroups>
But maven refuses to find this plugin via prefix. Full naming works though (com.diffplug.spotless:spotless-maven-plugin:check).
For the prefix to work my understanding is that the plugin should provide prefix info in its maven-metadata.xml at the group level. But this plugin does not come with such meta data file. It only has maven-metadata.xml at the artifact level for each artifact version. That is, I could not find maven-metadata.xml which content like this:
<metadata>
<plugins>
<plugin>
<name>Some Awesome Maven Plugin</name>
<prefix>somePrefix</prefix>
<artifactId>some-maven-plugin</artifactId>
</plugin>
</plugins>
</metadata>
- [ ] gradle or maven version
Maven 3.5.0
- [ ] spotless version
1.27.0 but I tried many other versions
- [ ] operating system and version
Ubuntu Xenial
- [ ] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
It's very simple.
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>1.21.0</version>
<configuration>
<java>
<removeUnusedImports/>
</java>
</configuration>
</plugin>
- [ ] copy-paste the full content of any console errors
[DEBUG] Resolving plugin prefix spotless from [com.diffplug.spotless, org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Using mirror repo (http://scctools.dt.vmware.com:8081/artifactory/repo) for plexus-snapshots (https://oss.sonatype.org/content/repositories/plexus-snapshots).
[DEBUG] Using mirror repo (http://scctools.dt.vmware.com:8081/artifactory/repo) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Using mirror repo (http://scctools.dt.vmware.com:8081/artifactory/repo) for codehaus.org (http://snapshots.repository.codehaus.org).
[DEBUG] Could not find metadata com.diffplug.spotless/maven-metadata.xml in local (/home/jenkins/.m2/repository)
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (/home/jenkins/.m2/repository)
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/home/jenkins/.m2/repository)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://scctools.dt.vmware.com:8081/artifactory/repo
Downloading: http://scctools.dt.vmware.com:8081/artifactory/repo/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://scctools.dt.vmware.com:8081/artifactory/repo/org/codehaus/mojo/maven-metadata.xml
Downloading: http://scctools.dt.vmware.com:8081/artifactory/repo/com/diffplug/spotless/maven-metadata.xml
[DEBUG] Writing tracking file /home/jenkins/.m2/repository/com/diffplug/spotless/resolver-status.properties
<snipped....>
[DEBUG] Could not find metadata com.diffplug.spotless/maven-metadata.xml in repo (http://scctools.dt.vmware.com:8081/artifactory/repo)
[DEBUG] Could not find metadata com.diffplug.spotless/maven-metadata.xml in local (/home/jenkins/.m2/repository)
[DEBUG] Skipped remote request for com.diffplug.spotless/maven-metadata.xml, already updated during this session.
[DEBUG] Failure to find com.diffplug.spotless/maven-metadata.xml in http://scctools.dt.vmware.com:8081/artifactory/repo was cached in the local repository, resolution will not be reattempted until the update interval of repo has elapsed or updates are forced
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (/home/jenkins/.m2/repository)
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/home/jenkins/.m2/repository)
- 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
-
bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100