我在bintray创建了一个组织。 当我尝试使用gradle-bintray-plugin将文件发布到属于组织的存储库时。 我遇到了一个问题:
HTTP/1.1 401 Unauthorized [message:This resource requires authentication]这是我在build.gradle代码:
apply plugin: 'com.jfrog.bintray' publishing { publications { MyPublication(MavenPublication) { groupId 'test.humbleadmin' artifactId 'm-example' artifact androidJar version version } } } bintray { user = 'my_bintray_username' key = 'my_bintray_key' publications = ['MyPublication'] pkg { repo = 'repos_name' name = 'pkage_name' userOrg = 'my_org_name' licenses = ['MIT'] labels = ['gear', 'gore', 'gorilla'] publicDownloadNumbers = true attributes= [name: 'value'] //Optional package-level attributes version { name = '1.0' desc = 'TestMaven Example 1.1.0 final' vcsTag = '1.0' attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] } } }我的代码出了什么问题? 谢谢你。
i have created a organization in bintray. when i try publishing files to the repository belong to the organization using gradle-bintray-plugin. i got a problem:
HTTP/1.1 401 Unauthorized [message:This resource requires authentication]here is my code in build.gradle:
apply plugin: 'com.jfrog.bintray' publishing { publications { MyPublication(MavenPublication) { groupId 'test.humbleadmin' artifactId 'm-example' artifact androidJar version version } } } bintray { user = 'my_bintray_username' key = 'my_bintray_key' publications = ['MyPublication'] pkg { repo = 'repos_name' name = 'pkage_name' userOrg = 'my_org_name' licenses = ['MIT'] labels = ['gear', 'gore', 'gorilla'] publicDownloadNumbers = true attributes= [name: 'value'] //Optional package-level attributes version { name = '1.0' desc = 'TestMaven Example 1.1.0 final' vcsTag = '1.0' attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] } } }what's wrong with my code? Thank u.
最满意答案
确保API密钥和用户名正确无误。 如果可以,尝试使用组织所有者和他的API密钥进行访问。
如果它没有帮助,尝试使用Curl对Bintray进行操作,您可以使用REST文档: https ://bintray.com/docs/api/。 看到你有权限。
Make sure that the API key and the user name is correct. Try to access with the organization owner and his API key, if you can.
If it doesn't help, try to operate on Bintray with Curl, you can use the REST doc: https://bintray.com/docs/api/. See that you have permissions.
更多推荐
发布评论