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/
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
.
Note: The bundle jar file contains all files like pom etc. I am able to upload the same bundle via UI.
This worked for me.
curl -ujorlina2 -u $SONATYPE_USER:$SONATYPE_PASSWORD --request POST -F "file=@xyz-"$VERSION"-bundle.jar" "https://oss.sonatype.org/service/local/staging/bundle_upload"
Here SONATYPE_USER
is the username for https://oss.sonatype.org
and $SONATYPE_PASSWORD
is the password for same.