These are chat archives for spring-cloud/spring-cloud

4th
Feb 2019
Spencer Gibb
@spencergibb
Feb 04 01:18
Finchley.SR2 is not compatible with boot 2.1.x. Greenwich.RELEASE is compatible. Otherwise the imports looks right.
@rajjaiswalsaumya :arrow_up:
Raj
@rajjaiswalsaumya
Feb 04 06:27
@spencergibb Thanks Spence. Let me give it a quick whirl to this
dnijssen
@dnijssen
Feb 04 08:43

Hello, I've got a very strange problem, whenever I include:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>Greenwich.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

then my com.squareup.okhttp3.okhttp dependency resolves as version 3.8.1 instead of 3.12.1 which I would expect after also including:

<dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>mockwebserver</artifactId>
      <version>3.12.1</version>
      <scope>test</scope>
    </dependency>
If I would remove the dependencyManagement its pulling in com.squareup.okhttp3.okhttp version 3.12.1 as I would expect instead of 3.8.1
So definitely related to the dependencyManagement section.
Marcos Barbero
@marcosbarbero
Feb 04 09:53
Hello @dnijssen it's probably a transitive dependency, as you have added the version it should have higher precedency
dnijssen
@dnijssen
Feb 04 09:58
Ah, but I can't seem to figure out which dependency is overriding the version.. :/
Marcos Barbero
@marcosbarbero
Feb 04 10:47
You can check it on the effective pom
dnijssen
@dnijssen
Feb 04 10:48
I've checked and can't find 3.8.1 anywhere, somehow its still resolving it
Marcos Barbero
@marcosbarbero
Feb 04 10:55
How are you finding this 3.8.1? In the IDE?
dnijssen
@dnijssen
Feb 04 10:56
Yes IntelliJ
Marcos Barbero
@marcosbarbero
Feb 04 10:56
Maybe it’s just an issue in the IDE?
dnijssen
@dnijssen
Feb 04 10:57
But doesn't happen whenever I'll remove the dependencyManagement from spring cloud, hmppf
Marcos Barbero
@marcosbarbero
Feb 04 10:58
It’s probably a transitive dependency of spring cloud. But as you are enforcing your version it takes procedency
However, the IDE is not resolving it correctly
Maybe excluding this dependency from the spring cloud dependencies will fix your problem
dnijssen
@dnijssen
Feb 04 12:21
No luck...
    <dependencies>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>Greenwich.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
        <exclusions>
          <exclusion>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>
dnijssen
@dnijssen
Feb 04 13:22
It's also an issue with a regular mvn clean package outside my IDE :/
Spencer Gibb
@spencergibb
Feb 04 16:24
@dnijssen you need to add it to dependency management above spring cloud
dnijssen
@dnijssen
Feb 04 18:39
hmm tried that! but cant seem to figure out where to place the com.squareup.okhttp3:okhttp exclusion
neither i can figure out which dependency keeps pulling in okhttp 3.8.1