首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到oss.sonatype.org的MISSING_CREDENTIAL凭据

找不到oss.sonatype.org的MISSING_CREDENTIAL凭据
EN

Stack Overflow用户
提问于 2021-04-18 23:59:35
回答 1查看 71关注 0票数 0

我尝试使用sbt-sonatype插件将我的项目发布到Maven Central。

按照这里的说明操作:https://github.com/xerial/sbt-sonatype#buildsbt

我有这样的配置:

代码语言:javascript
复制
  lazy val publicationSettings: Project => Project = _.settings(
    publishMavenStyle := true,
    publishTo := sonatypePublishToBundle.value,
    sonatypeCredentialHost := "s01.oss.sonatype.org",
    sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
    ...

credentials ~/.sbt/1.0/sonatype.sbt

代码语言:javascript
复制
credentials += Credentials("Sonatype Nexus Repository Manager",
        "s01.oss.sonatype.org",
        "myUser",
        "myPassword")

plugins.sbt

代码语言:javascript
复制
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")

但不知何故,它仍然查找oss.sonatype.org的凭据

代码语言:javascript
复制
sbt> sonatypeBundleRelease
[MISSING_CREDENTIAL] No credential is found for oss.sonatype.org. Prepare ~/.sbt/(sbt_version)/sonatype.sbt file.
    at xerial.sbt.sonatype.SonatypeClient.$anonfun$directCredentials$1(SonatypeClient.scala:45)
    at scala.Option.getOrElse(Option.scala:189)

如果在凭据中将主机更改为oss.sonatype.org,则会得到以下结果:

代码语言:javascript
复制
2021-04-18 17:53:04.183+0200  info [SonatypeService] sonatypeRepository  : https://oss.sonatype.org/service/local  - (SonatypeService.scala:23)
2021-04-18 17:53:04.185+0200  info [SonatypeService] sonatypeProfileName : pme123  - (SonatypeService.scala:24)
2021-04-18 17:53:04.186+0200  info [SonatypeClient] Reading staging repository profiles...  - (SonatypeClient.scala:108)
[info] Preparing a new staging repository for [sbt-sonatype] camunda-dmn-tester-root 0.11.0-SNAPSHOT
2021-04-18 17:53:04.544+0200  info [SonatypeClient] Reading staging profiles...  - (SonatypeClient.scala:120)
2021-04-18 17:53:04.685+0200 error [Sonatype] 
wvlet.airframe.http.HttpClientException: [403: Forbidden] Request failed: <html>
  <head>

我错过了什么吗?

EN

回答 1

Stack Overflow用户

发布于 2021-04-19 00:58:28

似乎只有在project中运行该命令时才会采用这些设置。

代码语言:javascript
复制
sbt> project server
sbt> sonatypeBundleRelease

这可以解决这个问题,或者至少解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67150581

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档