繁体   English   中英

从 GitHub Maven Package Repo 下载包导致 400 错误

[英]Downloading package from GitHub Maven Package Repo results in a 400 error

我按照https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#authenticating-to-github 上的说明进行操作-packages ,但我无法获得mvn install来下载工件。

错误是这样的:

[ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for project com.project:myproject:jar:1.0: Failed to collect dependencies at com.dependency:mydependency:jar:0.1.331: Failed to read artifact descriptor for com.dependency:mydependency:jar:0.1.331: Could not transfer artifact com.dependency:mydependency:pom:0.1.331 from/to github (https://maven.pkg.github.com/OWNER/REPO): Failed to transfer file: https://maven.pkg.github.com/OWNER/REPO/com/dependency/mydependency/0.1.331/mydependency-0.1.331.pom. Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]

在浏览器中打开 URL 并提供 GitHub 用户名和访问令牌显示以下错误:

Unable to download maven package : "GraphQL call failed: Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'], but your token has only been granted the: ['admin:gpg_key', 'admin:org', 'admin:org_hook', 'admin:public_key', 'admin:repo_hook', 'delete_repo', 'gist', 'notifications', 'repo', 'user'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."

修复权限允许mvn install目标正确完成。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM