【问题标题】:Upload artifact bundle to sonatype将工件包上传到 sonatype
【发布时间】:2018-05-06 06:46:06
【问题描述】:

我想通过 curl 命令将工件包(jar)上传到 https://oss.sonatype.org。我遇到了 URL 问题。

curl -v -u 'username':'password' --upload-file xyz-version-bundle.jar https://oss.sonatype.org/content/repositories/com/abc/xyz/version/

我已经通过上面的 curl 命令进行了尝试,并且尝试了许多 URL 变体,但仍然得到 404 - Repository with ID="com" not found

注意:bundle jar 文件包含 pom 等所有文件。我可以通过 UI 上传相同的 bundle。

【问题讨论】:

  • 您需要提供一个暂存存储库或一个快照存储库,您想在其中上传您的 jar 文件。但我建议直接通过 Maven 来完成,而不是使用 curl 来这样做...你有 gpg 密钥等并为此签署了您的工件?
  • 我想将它上传到临时存储库,是的,我有 gpg 密钥,并且我已经签署了捆绑 jar 中的所有文件。我可以通过 UI 上传它,但想自动化这个过程。

标签: maven curl nexus sonatype


【解决方案1】:

这对我有用。

curl -ujorlina2 -u $SONATYPE_USER:$SONATYPE_PASSWORD --request POST -F "file=@xyz-"$VERSION"-bundle.jar" "https://oss.sonatype.org/service/local/staging/bundle_upload"

这里SONATYPE_USERhttps://oss.sonatype.org 的用户名,$SONATYPE_PASSWORD 是相同的密码。

【讨论】:

猜你喜欢
  • 2018-10-06
  • 1970-01-01
  • 2019-10-28
  • 1970-01-01
  • 1970-01-01
  • 2017-08-14
  • 2012-04-24
  • 1970-01-01
  • 2015-12-29
相关资源
最近更新 更多