sbt-release将工件发布到错误的存储库

时间:2016-03-14 18:39:56

标签: scala sbt sbt-release

因此,我尝试使用sbt-release,并且我遇到了将工件发布到我的快照存储库而不是发布存储库的问题。

val Organization = "com.mycompany"
val Name = "My Service"
val Version = "0.1-SNAPSHOT"
...
settings = Defaults.coreDefaultSettings ++ Seq(
  name := Name,
  organization := Organization,
  version := Version,
  scalaVersion := ScalaVersion
  ...
  assemblyJarName in assembly := s"my-service-${Version}.jar",
 ...
)
publishTo := {
    val nexus = "my.nexus.url.com/repositories/"
    if (isSnapshot.value)
      Some("snapshots" at nexus + "snapshots/")
    else
      Some("releases"  at nexus + "releases/")
  },
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")

如果我从版本中删除-SNAPSHOT,那么它会将其发布到正确的存储库,但不应该告诉它自己这样做吗?

此外,如果我摆脱if (isSnapshot.value),那么sbt publish也将发布到错误的存储库。

如果我能得到一些帮助,我会非常感激。

1 个答案:

答案 0 :(得分:0)

这是我在这里的版本。它超过了版本.bt,它应该存储0.1-SNAPSHOT