2

In my pom.xml in section,I have added following dependency:

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

Then in <dependencies> section,I am adding following :

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

Why I am getting compile time error : Project build error: 'dependencies.dependency.version' for com.amazonaws:aws-java-sdk-secretsmanager:jar is missing.

javaguy
  • 927
  • 2
  • 16
  • 37
  • Do you use a parent pom? If not, your dependency must contain a version. With Maven 3 you can use the ${project.version} notation. Check more [here](http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance) – Aviza Jul 17 '19 at 14:06
  • @Aviza That is not true. He/She expects the version to come from the imported bom, which should work _if_ this bom really specifies a version for the desired artifact. – J Fabian Meier Jul 17 '19 at 14:09
  • From its [description](https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-bom/1.11.95) doesn't seem that secretsmanager is a dependency – Aviza Jul 17 '19 at 14:26

2 Answers2

2

Please consider using the AWS SDK for Java V2. Amazon Strongly recommends moving away from V1 to V2.

To use AWS Secrets Manager, use these POM dependencies:

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

        </dependencies>
    </dependencyManagement>

and

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

For this service, it seems it wants a version for AWS Secrets Manager.

Here you can find all of the Secret Manager code examples.

smac2020
  • 9,637
  • 4
  • 24
  • 38
0

Yea secrets manager was released in April 2018. This bom doesn't have secrets manager in it's collection of dependencies

committedandroider
  • 8,711
  • 14
  • 71
  • 126