spring-attic / spring-cloud-gcp

Integration for Google Cloud Platform APIs with Spring
Apache License 2.0
704 stars 694 forks source link

More Details on Gradle BOM #2543

Closed jamesward closed 2 years ago

jamesward commented 3 years ago

In the docs for using the BOM it isn't clear how to use the BOM with Gradle.

jamesward commented 3 years ago

It looks like what is needed is (for build.gradle.kts):

dependencyManagement {
    imports {
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:Hoxton.RELEASE")
    }
}
meltsufin commented 3 years ago

For 1.2.x versions of the project, we're actually part of the Spring Cloud BOM (spring-cloud-dependencies), and you don't really need to include our spring-cloud-gcp-dependencies BOM, unless you want a different version of the dependencies. We should probably make this point more clear in the section of the docs.

jamesward commented 3 years ago

I tried without the BOM and got:

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find org.springframework.cloud:spring-cloud-gcp-starter-firestore:.
jamesward commented 3 years ago

For reference my plugins:

plugins {
    id("org.springframework.boot") version "2.3.4.RELEASE"
    id("io.spring.dependency-management") version "1.0.10.RELEASE"
    kotlin("jvm") version "1.4.10"
    kotlin("plugin.spring") version "1.4.10"
}
meltsufin commented 3 years ago

Taken directly from start.spring.io:

plugins {
  id 'org.springframework.boot' version '2.3.4.RELEASE'
  id 'io.spring.dependency-management' version '1.0.10.RELEASE'
  id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
  mavenCentral()
}
ext {
  set('springCloudVersion', "Hoxton.SR8")
}
dependencies {
  implementation 'org.springframework.cloud:spring-cloud-gcp-starter'
  testImplementation('org.springframework.boot:spring-boot-starter-test') {
    exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
  }
}
dependencyManagement {
  imports {
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  }
}
test {
  useJUnitPlatform()
}
jamesward commented 3 years ago

Ah, so I need that BOM. I guess that is what should be in the docs :) I didn't start with start.spring.io

meltsufin commented 3 years ago

Yep, keeping the issue open to update the docs. Thanks!

elefeint commented 2 years ago

@meltsufin Is this still relevant?

meltsufin commented 2 years ago

I think we can close it. Our current reference documentation does show Spring Cloud GCP BOM usage for Gradle.