Updating maven-metadata.xml when publishing to an SFT Resolver with SBT

611 views Asked by At

I'm trying to publish artifacts to an SFTP resolver. After some initial struggle, the following configuration works fine:

publishTo := Some(Resolver.sftp("foo-resolver", "domain", 22, "path/to/repo")
  .as("me", new java.io.File("path/to/key")))

The issue I'm having is that this doesn't create or update the maven-metadata.xml file, even though I've enabled the maven resolver plugin (addMavenResolverPlugin).

I feel the problem is linked to the SFTP resolver, since replacing my publishTo as follows will create / update maven-metadata.xml:

publishTo := Some("foo-resolver" at "file:////path/to/some/local/folder")

Is there some limitation inherent to the SFTP resolver? I couldn't find any hint of this in the documentation - if anything, the 0.13.8 release notes (http://notes.implicit.ly/post/114141158904/sbt-0138) seem to imply it should work:

Additionally, sbt will now be able to fully construct maven-metadata.xml files when publishing to remote repositories

I'm using SBT 0.13.13.

1

There are 1 answers

0
mahmoud mehdi On

I have encountered the same issue while trying to publish my jar to the AWS codeartifact.

Adding the plugin sbt-maven-resolver to the plugins.sbt fixed the issue :

addSbtPlugin("org.scala-sbt" % "sbt-maven-resolver" % "0.1.0")

when you run sbt assembly after adding the plugin, the maven-metadata.xml file will be created (which solves the problem)