如何修复不可解析的导入POM:com.google.cloud:spring-cloud-gcp依赖关系



尝试从https://github.com/GoogleCloudPlatform/spring-cloud-gcp

  1. 许多由于测试(单元和检查样式(失败而导致的编译/安装尝试失败-决定只禁用和/或不因测试而失败-很好,成功了,编译了整个构建(所有子项目(
  2. 想要将spring-cloud-gcp数据firestore示例(pom在下面(部署到cloud run,所以更改了pom中的父引用(如pom中建议/记录的那样(
  3. 现在无法编译/安装spring cloud gcp数据firestore示例并获得此错误"**不可解析的导入POM:com.google.cloud:spring-cloud gcp依赖项:POM:2.3.12.RELEASE未在中找到https://repo.maven.apache.org/maven2**">

我试过:

  1. 向pom添加额外的spring-maven repo(请参阅下面的pom(-运气不好,根据错误消息,maven似乎甚至没有检查添加的repo
  2. 引用/使用不同版本的spring-boot-starter父级-运气不好,错误中没有任何更改
  3. mvn-U干净编译-运气不好

有人有什么想法吗?非常感谢任何建议。

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Spring Cloud GCP Code Sample - Spring Data Firestore</name>
<artifactId>spring-cloud-gcp-data-firestore-sample</artifactId>
<properties>
<integration-test.tags.exclude>native</integration-test.tags.exclude>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-data-firestore</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- JUnit5 is required for Test Containers. -->
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>gcloud</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>it.native</name>
</property>
</activation>
<properties>
<!-- Include only native tests, exclude all others -->
<integration-test.tags.include>native</integration-test.tags.include>
<integration-test.tags.exclude/>
<!-- Native build args -->
<native.build.args>
--enable-url-protocols=http,https
--no-fallback
--no-server
</native.build.args>
<!-- Paketo buildpacks used for building native image -->
<builder>paketobuildpacks/builder:tiny</builder>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-native</artifactId>
<version>${spring-native.version}</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-graalvm-support</artifactId>
<version>${google-cloud-graalvm-support.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-indexer</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-aot-maven-plugin</artifactId>
<version>${spring-native.version}</version>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-native-support</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>test-generate</id>
<goals>
<goal>test-generate</goal>
</goals>
</execution>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>${classifier}</classifier>
<image>
<builder>${builder}</builder>
<name>${project.artifactId}:test</name>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>${native.build.args}</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
</env>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
</image>
</configuration>
<executions>
<execution>
<id>build-docker-image-before-integration-tests</id>
<phase>pre-integration-test</phase>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

您正在从project.version继承com.google.cloud:spring-cloud-gcp-dependencies的版本,在您的情况下是2.3.12.RELEASE。

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

实际上,您希望指定maven存储库中列出的有效版本。

相关内容

  • 没有找到相关文章

最新更新