puzzled
puzzled

Reputation: 631

google cloud shell not able to get maven dependency for spring-cloud-gcp-starter-secretmanager

I am trying to add secrets to spring boot app.

so added to pom.xml

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
    <version>3.4.0</version>
</dependency>

Maven version is

xyz_pqr@cloudshell:~/projects/spring-petclinic (xyzprj)$ ./mvnw --version
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f) Maven home:
/home/xyz_pqr/.m2/wrapper/dists/apache-maven-3.8.2-bin/1um3pu5poco57pibs3g92d6vrf/apache-maven-3.8.2
Java version: 17.0.4, vendor: Debian, runtime:
/usr/lib/jvm/java-17-openjdk-amd64 Default locale: en_US, platform
encoding: ANSI_X3.4-1968 OS name: "linux", version: "5.15.65+", arch:
"amd64", family: "unix" xyz_pqr@cloudshell:~/projects/spring-petclinic
(xyzprj)$

It gives the issue

Failed to execute goal on project spring-petclinic: Could not resolve dependencies for project org.springframework.samples:spring-petclinic:jar:3.0.0-SNAPSHOT: Could not find artifact org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0 in spring-snapshots (https://repo.spring.io/snapshot)

The complete error is

[INFO] ------------< org.springframework.samples:spring-petclinic

------------ [INFO] Building petclinic 3.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom Downloading from spring-milestones: https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom [WARNING] The POM for org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0 is missing, no dependency information available Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar Downloading from spring-milestones: https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.274 s [INFO] Finished at: 2023-01-14T23:34:50Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project spring-petclinic: Could not resolve dependencies for project org.springframework.samples:spring-petclinic:jar:3.0.0-SNAPSHOT: Could not find artifact org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0 in spring-snapshots (https://repo.spring.io/snapshot) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException xyz_pqr@cloudshell:~/projects/spring-petclinic (xyzprj)$

Upvotes: 0

Views: 433

Answers (1)

puzzled
puzzled

Reputation: 631

The issue is with document at Secret Management

it says

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
</dependency>

but should be

<dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
</dependency>

so replace org.springframework.cloud with com.google.cloud

enter image description here

Upvotes: 2

Related Questions