SBT cannot find snapshots in an Artifactory maven repository

前端 未结 2 454
终归单人心
终归单人心 2021-01-05 07:55

I\'m just starting out trying to set up a workflow with scala and sbt, and I\'m having trouble with my repository. I am trying to publish a simple test library, which is co

相关标签:
2条回答
  • 2021-01-05 08:29

    The issue was not with my sbt configuration after all, but with my repository server.

    I'm using Artifactory, and the snapshots repository was configured to use "unique snapshots" by default. The filenames of these snapshots are modified as they are published to include a timestamp, which sbt 13.x doesn't seem to understand.

    After changing the repository's "Maven Snapshot Version Behaviour" from "Unique" to "Nonunique", everything started to work.

    0 讨论(0)
  • 2021-01-05 08:49

    actually, the inconsistency of timestamp & build number suffix in maven-metadata.xml and jar/pom files genereated by sbt publish lead to such error.

    different suffix

    with the following plugin sbt-maven-resolver during deployment procedure, the suffix will be kept same, looks like: same suffix

    currently, adding this plugin on the deployment side (once the timestamp & build suffix are same, both sbt/maven can find the snapshots):

    in plugins.sbt

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

    hope to solve your case.

    0 讨论(0)
提交回复
热议问题