问题描述
我想通过以下方式将工件捆绑包(jar)上传到 https://oss.sonatype.org curl命令.我遇到网址问题.
I want to upload an artifact bundle(jar) to https://oss.sonatype.org via curl command. I am facing issues with 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
.
I have tried via above curl command and I have tried many variations in URL but still getting 404 - Repository with ID="com" not found
.
注意:捆绑包jar文件包含pom等所有文件.我可以通过UI上传同一捆绑包.
Note: The bundle jar file contains all files like pom etc. I am able to upload the same bundle via UI.
推荐答案
这对我有用.
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_USER
是https://oss.sonatype.org
的用户名,$SONATYPE_PASSWORD
是其密码.
Here SONATYPE_USER
is the username for https://oss.sonatype.org
and $SONATYPE_PASSWORD
is the password for same.
这篇关于将工件捆绑包上传到声呐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!