簡體   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