sbt / sbt-maven-resolver

An sbt plugin to resolve dependencies using Aether
12 stars 9 forks source link

SBT does not update maven-metadata.xml when publishing to an ssh / sft resolver #3

Open nrinaudo opened 7 years ago

nrinaudo commented 7 years ago

steps

Attempt to publish artifacts to an ssh or sft resolver with sbt 0.13.13:

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

problem

Everything is published as you'd expect, but the maven-metada.xml file is not created or updated.

expectation

The behaviour should be the same as when publishing to a local repository. Replacing our previous publishTo as follows will create and update maven-metadata.xml:

publishTo := Some("foo-resolver" at "file:////path/to/some/local/folder")
jgonian commented 7 years ago

maven-metadata.xml is used by the versions-maven-plugin:use-latest-releases in order to replace any versions with the latest release version inside a pom.xml file.

However, since SBT is not updating the maven-metadata.xml file, versions plugin is unable to discover the new versions that have been released via sbt-release.

jgonian commented 6 years ago

It seems that the workaround is to use the maven resolver plugin by creating project/maven.sbt as described here: http://www.scala-sbt.org/1.0/docs/Combined+Pages.html#Maven+resolver+plugin

However, this workaround will not work with SBT 1.x. See: sbt/sbt#3486

luck-cheng commented 7 months ago

I use sbt-aether-deploy to resolve it