Closed ptab closed 3 years ago
Sbt plugins are published to incorrect paths. that is correct. This is well-known, and no fix is possible :(
My fork is able to publish the maven-metadata.xml
file with the correct artifactId
, but in order to achieve that it copies plain Java classes directly from the Maven sources (which is not ideal). If you'd like to check it out I can create a PR.
Does SBT resolve the plugin again correctly?
Yes, I'm able to use the published plugin in other SBT projects; and I'm also able to find the latest available version of this plugin using the maven-metadata.xml
file.
If you are willing to create a PR, then its interesting.
At my organization we use this plugin to publish SBT projects to our internal Nexus instance, and it works great for regular projects. However, when publishing our internal SBT plugins, we receive a
400 Bad Request
back from Nexus when uploading themaven-metadata.xml
file (all other uploads work well).After quite a bit of investigation, we have found that Nexus rejects the
maven-metadata.xml
file if eithergroupId
orartifactId
does not match the upload path (see https://issues.sonatype.org/browse/NEXUS-16853). When we try to publish an SBT plugin:The generated file will contain:
And since the value of
artifactId
in the file (sbt-library-settings
) does not match the path (sbt-library-settings_2.12_1.0
), this file is rejected.I have forked this project and created a working solution (see https://github.com/arktekk/sbt-aether-deploy/compare/master...ptab:6ba41e9), but since it requires a change to internal Maven classes (see https://github.com/ptab/sbt-aether-deploy/commit/6ba41e9f88707a995079bd85fc244670529c7d02#diff-802d937d4289a6fa48eea5b6ee27325158590172ede247ca94c74dd76b433eeeR60-R63) I was forced to copy over a few Java classes which is not great.
Is there a better way to fix this issue? And if not, would you accept a PR that includes copies of these internal Maven classes?