Open matts19 opened 4 years ago
I have the same issue. It'll be much more handy if people can use the shorter version for this plugin otherwise it will just fizzle out as one of those "recommendations"
This might be a dumb question, but I'm not great with maven. At the very top of our plugin-maven readme, we've got a little plugin block to copy, and it looks like you copied it exactly right. We also have an example command line mvn spotless:check
. I do a little integration testing for each release to confirm that it is still working, and it is, for me.
I don't understand how having a <pluginGroups>
in your settings.xml
comes into it at all. I read these maven docs which reference it, but I still don't get it.
Regardless of whether I understand the problem or not, we're happy to take a PR to fix/improve it. Here is our POM template:
And here is how we populate and run it:
I'm happy to help with any gradle integration issues, but I don't know anything about the maven part.
Closing due to inactivity and inability to replicate. Happy to reopen with an open source repo that demonstrates the issue.
I have the same issue.
$ mvn -X spotless:check
...
[DEBUG] Could not find metadata com.diffplug.spotless/maven-metadata.xml in central (https://repo.maven.apache.org/maven2)
......
......
[ERROR] No plugin found for prefix 'spotless' in the current project and in the plugin groups [com.diffplug.spotless, com.github.spotbugs, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/luowentao/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
I'm not familiar with building a maven plugin neither. But I do find something, I guess.
There is NO maven-metadata.xml
under https://repo.maven.apache.org/maven2/com/diffplug/spotless/.
As a contrast, there are two other pluginGroups , which have maven-metadata.xml
in centra repo.
<metadata>
<plugins>
<plugin>
<name>SpotBugs Maven Plugin</name>
<prefix>spotbugs</prefix> <!-- HERE -->
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</metadata>
So, maybe there is something go wrong during DEPLOY phrase, or maybe maven-publish error? I'm not quit sure, hope this will give some clue.
👋 It is unfortunately still an issue.
As @vlaw said the repository is missing maven-metadata file (another example for sonar:sonar
plugin : maven-metadata.xml)
According to the documentation, this file at group level should be automatically uploaded when using "maven-plugin" as packaging type. I couldn't find where and if this packaging type is specified somewhere in the Gradle build configuration of the plugin.
Furthermore, it says here that the Gradle "maven-publish" plugin seems to ignore the packaging type. I don't know if it's still the case, but I would suppose that this plugin is used for traditional Maven projects, and that most of the Maven plugins are built and published with Maven itself.
I hope this can help, it would be really nice to be able to simply call mvn spotless:check
(on a global GitHub workflow for instance)