gpt4 book ai didi

sbt - 如何使用来自 sbt-pgp 的 publishSigned 发布到 Sonatype?

转载 作者:行者123 更新时间:2023-12-04 14:13:45 25 4
gpt4 key购买 nike

我想使用 sbt-pgp 0.8 发布带有 sbt 的 Scala 库。我已经注册了 groupId org.bitbucket.sergey_kozlov在 Sonatype。

我的 build.sbt :

organization := "org.bitbucket.sergey_kozlov"

name := "playingcards"

version := "0.1-SNAPSHOT"

publishMavenStyle := true

publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

publishArtifact in Test := false

pomIncludeRepository := { _ => false }

pomExtra :=
<url>https://bitbucket.org/sergey_kozlov/playingcards</url>
<licenses>
<license>
<name>The MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://bitbucket.org/sergey_kozlov/playingcards.git</url>
<connection>scm:git:ssh://git@bitbucket.org/sergey_kozlov/playingcards.git</connection>
</scm>
<developers>
<developer>
<id>skozlov</id>
<name>Sergey Kozlov</name>
<email>mail.sergey.kozlov@gmail.com</email>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>

libraryDependencies += "junit" % "junit" % "4.11"

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"

还有 ~/.sbt/0.13/plugins/gpg.sbt :
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8")
project/ 下没有其他文件有助于构建定义的目录。

当我输入 publishSigned在 sbt 控制台中,我收到以下错误:
[error] (*:publishSigned) java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/playingcards/playingcards_2.10/0.1-SNAPSHOT/playingcards_2.10-0.1-SNAPSHOT-sources.jar was refused by the server: Forbidden

请注意,该 URL 不包含 organization .

如何正确发布我的工件?

最佳答案

正如您指出的,您的网址丢失 组织属性,这就是您收到此错误的原因。尝试运行 show organization在 sbt 控制台中以确保您的组织属性正确。如果它没有帮助,请尝试在 sbt 中明确指定您的项目并设置 组织那里的属性(property)。

lazy val core = (project in file(".")).settings(
organization := "org.bitbucket.sergey_kozlov"
//other properties here
)

关于sbt - 如何使用来自 sbt-pgp 的 publishSigned 发布到 Sonatype?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24837023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com