将工件包上传到 sonatype

Upload artifact bundle to sonatype

我想通过 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

这对我有用。

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是相同的密码。