【问题标题】:Project build error: 'dependencies.dependency.version' for com.amazonaws:aws-java-sdk-secretsmanager:jar is missing项目构建错误:com.amazonaws:aws-java-sdk-secretsmanager:jar 的“dependencies.dependency.version”缺失
【发布时间】:2019-11-26 07:39:06
【问题描述】:

在我的 pom.xml 部分中,我添加了以下依赖项:

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-bom</artifactId>
            <version>1.11.95</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

然后在&lt;dependencies&gt; 部分,我添加以下内容:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-secretsmanager</artifactId>
</dependency>

为什么会出现编译时错误: 项目构建错误:com.amazonaws:aws-java-sdk-secretsmanager:jar 的“dependencies.dependency.version”缺失。

【问题讨论】:

  • 你使用父 pom 吗?如果不是,您的依赖项必须包含一个版本。使用 Maven 3,您可以使用 ${project.version} 表示法。查看更多here
  • @Aviza 这不是真的。他/她期望版本来自导入的 bom,如果 如果这个 bom 确实为所需的工件指定了一个版本,这应该可以工作。
  • 从它的description 看来,secretsmanager 不是一个依赖项

标签: amazon-web-services maven maven-3 aws-secrets-manager


【解决方案1】:

是的,秘密管理器于 2018 年 4 月发布。这个 bom 的依赖项集合中没有秘密管理器

【讨论】:

    【解决方案2】:

    请考虑使用AWS SDK for Java V2。亚马逊强烈建议从 V1 迁移到 V2。

    要使用 AWS Secrets Manager,请使用以下 POM 依赖项:

    <dependencyManagement>
            <dependencies>
                 <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>bom</artifactId>
                     <version>2.17.46</version>
                    <type>pom</type>
                </dependency>
    
            </dependencies>
        </dependencyManagement>
    

    <dependency>
            <groupId>software.amazon.awssdk</groupId>
             <artifactId>secretsmanager</artifactId>
             **<version>2.17.46</version>**
       </dependency>
    

    对于这项服务,它似乎需要 AWS Secrets Manager 的版本。

    在这里你可以找到所有的Secret Manager code examples

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-26
      • 2017-03-01
      • 2015-09-06
      • 2022-08-13
      • 1970-01-01
      • 1970-01-01
      • 2016-09-25
      • 2013-06-23
      相关资源
      最近更新 更多