【问题标题】:Maven Unable to load AWS credentials from any provider in the chainMaven 无法从链中的任何提供商加载 AWS 凭证
【发布时间】:2018-09-21 03:21:59
【问题描述】:

我正在尝试删除一个使用 AWS 的 maven 项目。我有一个带有密钥和密码的 aws IAM 用户。我运行 aws configure 并在默认帐户中配置了 ~/.aws/credentials 文件。但是,当我运行 maven clean install 时,出现以下错误:

Failed to execute goal on project project-name: 
Could not resolve dependencies for project com.project:project-name:war:1.0: 
Failed to collect dependencies at com.project:commons-java:jar:1.0.0: 
Failed to read artifact descriptor for com.project:commons-java:jar:1.0.0: 
Could not transfer artifact com.project:commons-java:pom:1.0.0 
from/to project-maven-repo-releases (s3://project-maven-repo/releases): 
Unable to load AWS credentials from any provider in the chain

显然,maven 无法从 s3 加载依赖项。我已确认我的 IAM 用户具有 s3 权限。而且,即使 s3 是“无区域的”,我也为 IAM 帐户提供了正确的区域。我也尝试过导出 AWS 变量,但无济于事。知道可能是什么问题吗?

谢谢!

【问题讨论】:

  • 我也遇到了同样的问题,请问你最后找到解决办法了吗?

标签: amazon-web-services maven amazon-s3


【解决方案1】:

一段时间以来,我一直在为同样的问题苦苦挣扎。在检查了我在 AWS 中的权限并完成了各种其他故障排除步骤后,我认为我的问题已通过更改构建路径和我尝试构建的存储库中的许多不同文件的目录权限来解决。我无意中克隆了它们并将它们复制为“root”,这样,即使有 sudo 权限,maven 也无法读取我的 Amazon 凭据。

您可以采取的另一个缩小问题范围的步骤是确定故障所在。我通过下载AWS python sample 来完成此操作,它将尝试创建并添加到您的 s3 中的存储桶。如果这可行,则意味着问题出在 maven 上,其他应用程序可以访问您的凭据就好了,并且就 s3 而言,您拥有正确的权限。如果 python 示例也不起作用,则更容易进入和调试问题的确切位置(在我看来)。

【讨论】:

    猜你喜欢
    • 2017-06-15
    • 2023-03-11
    • 1970-01-01
    • 2021-08-11
    • 2019-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-08-08
    • 2017-07-10
    相关资源
    最近更新 更多