https://bintray.com/docs/usermanual/formats/formats_mavenrepositories.html#_working_with_gradle确保您使用的是userOrg参数,因为您的回购在组织主题下,而不在用户下.在此处检查第4步: https://github. com/bintray/gradle-bintray-plugin#step-4-add-your-bintray-package-information-the-bintray-closure这是可以正常工作的build.gradle:buildscript { repositories { jcenter() } dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' }}plugins { id "com.jfrog.bintray" version "1.7"}apply plugin: 'com.jfrog.bintray'apply plugin: 'java'bintray { user = 'myuserusername' key = '**********' pkg { repo = 'gradlerepo' name = 'gradlepackage' userOrg = 'myorgname' version { name = '1.0-Final' } }}I'm trying to upload a android library module from android studio,followed by this blog: https://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en(1)Result:- BUILD SUCCESSFUL(2)Result:- Getting below error-FAILURE: Build failed with an exception.What went wrong:Execution failed for task ':acr:bintrayUpload'.I checked many times and sure my username and apikey is correct.(In username i'm using organization name instead of bintray username because my repository is created under organization).If anyone has an idea, I would appreciate the help :) 解决方案 In Bintray your username must be the username of your user account and not the Organisation.If you are the owner of the repo then the permission mechanism will allow the action.Some documentation links:https://github.com/bintray/gradle-bintray-plugin#readmehttps://bintray.com/docs/usermanual/formats/formats_mavenrepositories.html#_working_with_gradleEDIT:Make sure you are using the userOrg parameter, since your repo is under the organization subject and not under the user.check step 4 here:https://github.com/bintray/gradle-bintray-plugin#step-4-add-your-bintray-package-information-to-the-bintray-closureHere is a working build.gradle:buildscript { repositories { jcenter() } dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' }}plugins { id "com.jfrog.bintray" version "1.7"}apply plugin: 'com.jfrog.bintray'apply plugin: 'java'bintray { user = 'myuserusername' key = '**********' pkg { repo = 'gradlerepo' name = 'gradlepackage' userOrg = 'myorgname' version { name = '1.0-Final' } }} 这篇关于在Bintray上上传二进制文件时未经授权的HTTP/1.1 401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-13 12:00