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

17th
Apr 2017
Mike Dalrymple
@watchwithmike
Apr 17 2017 16:54
@marcingrzejszczak Thanks for the pointer to https://www.javadoc.io that's helpful on may fronts. @dsyer I'm waiting on approval from the mother ship before I can contribute but happy to submit some doc PRs once I can get sign off on the contributor agreement. I guess I'm old school but I find navigating JavaDocs to be a useful way of getting my head around an API and of course generating them locally is always an option. Cheers all.
Marcin Grzejszczak
@marcingrzejszczak
Apr 17 2017 18:01
cool @watchwithmike :)
Mike Dalrymple
@watchwithmike
Apr 17 2017 20:52
Is it possible to load spring-cloud dependencies without using the BOM? I'm using Gradle and running into problems with the aws-java-sdk that is being imported. I seem to be getting 1.11.98 forced on me but I need 1.11.119 (or thereabouts). There's a library conflict with com.jayway.jsonpath that seems to be fixed in > .98.
Jon Schneider
@jkschneider
Apr 17 2017 20:55
@watchwithmike i’d have to run a test, but it looks like a dynamic constraint on that dependency (e.g. [1.11.119,)) would force the bom to be ignored: https://github.com/spring-gradle-plugins/dependency-management-plugin/blob/master/src/main/java/io/spring/gradle/dependencymanagement/internal/VersionConfiguringAction.java#L65-L68
I would expect the plugin to ignore any direct dependency that has a version specified at all
also, not sure what you mean by "load spring-cloud dependencies"
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:00
Specifically we're bringing in spring-cloud-starter-eureka and for Spring Cloud dependencies it doesn't seem like there's a way to explicitly declare the version so it's relying on (I'm assuming) the BOM.
There's still some confusion (for me) as to where the dependencies are being declared and the dependency insight just states (selected by rule)
Jon Schneider
@jkschneider
Apr 17 2017 21:02
the dependency-management plugin never adds any dependencies to your build, it just informs the versions that are selected when you leave off a version (i.e. org.springframework.cloud:spring-cloud-starter-eureka)
if you are picking up aws transitively from spring-cloud-starter-eureka, then of course you are getting whatever version that was built with
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:03
Then how would we exclude that transitive dependency or is that even possible?
Jon Schneider
@jkschneider
Apr 17 2017 21:03
do you want to exclude it or upgrade its version?
Dave Syer
@dsyer
Apr 17 2017 21:04
I'm not a gradle user but isn't that what the dependency management plugin is for?
In maven I would add a dependency to the dependency management section of the Pom
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:04
We are currently getting 1.11.98 from Eureka (assuming)
Dave Syer
@dsyer
Apr 17 2017 21:04
I would assume the gradle plugin has the same feature
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:05
We want 1.11.119 which is declared in another library we have built
Dave Syer
@dsyer
Apr 17 2017 21:05
Did you read its docs?
Jon Schneider
@jkschneider
Apr 17 2017 21:05
even in maven @dsyer , adding a dependency to dependencyManagement does not cause it to be added to the graph
so i think all you need to do @watchwithmike is add a first order dependency on aws sdk with the version you want
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:06
under dependencies { compile 'com.amazonaws:aws-java-sdk:1.11.+' }
Jon Schneider
@jkschneider
Apr 17 2017 21:06
yep
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:06
that gets overwritten by the Eureka dependency
Dave Syer
@dsyer
Apr 17 2017 21:06
Isn't it already in the graph? But with the wrong version?
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:07
and I should say we tried 1.11.119
@dsyer yes
Dave Syer
@dsyer
Apr 17 2017 21:07
Maybe I didn't understand the question. I'm quite happy to be ignored if I did
Jon Schneider
@jkschneider
Apr 17 2017 21:07
can you try the range @watchwithmike ?
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:07
Our core problem is that there seems to be a conflict with a class called JsonRead in com.jayawy and net.minidev.
Jon Schneider
@jkschneider
Apr 17 2017 21:08
totally get it
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:08
both 1.11.+ and 1.11.119 get 1.11.98 (selected by rule)
Jon Schneider
@jkschneider
Apr 17 2017 21:09
can you add a { force = true } after it?
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:10
compile ('com.amazonaws:aws-java-sdk:1.11.+') { force = true }
compile ('com.amazonaws:aws-java-sdk:1.11.119') { force = true }
same result
.98
nebula’s works almost the same as spring.dependency-management, but allows normal conflict resolution to take place
you can also remove the force
Marcin Grzejszczak
@marcingrzejszczak
Apr 17 2017 21:11
I haven't read the whole conversation but are you trying to force a dependency?
Jon Schneider
@jkschneider
Apr 17 2017 21:12
he is trying to upgrade a dependency being influenced by the bom
Marcin Grzejszczak
@marcingrzejszczak
Apr 17 2017 21:12
ah
you can use a resolution strategy
to force a dependency version
Jon Schneider
@jkschneider
Apr 17 2017 21:12
super dangerous @marcingrzejszczak because resolutionStrategies are applied in the order in which they are defined in gradle
Marcin Grzejszczak
@marcingrzejszczak
Apr 17 2017 21:13
yeah - I'm not saying that it's the best solution
Jon Schneider
@jkschneider
Apr 17 2017 21:13
i think we can fix the dependency-management plugin, but the nebula solution will work now
Marcin Grzejszczak
@marcingrzejszczak
Apr 17 2017 21:13
I also think (I may be wrong) that this will get deprecated
:+1:
cause AFAIR they're changing the way the graph is built in Gradle and you won't be able to alter it (but maybe I'm confusing it with some other mechanism)
Dave Syer
@dsyer
Apr 17 2017 21:14
Would be good to avoid nebula is possible. It seems to cause a lot of other issues for Spring Boot apps.
Jon Schneider
@jkschneider
Apr 17 2017 21:14
i promise it will be ok for this use case ;)
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:15
Thanks folks, I think we're going to resolve this with an exclude of the conflicting com.jayway transitive library... Things seem to be OK with that.
Jon Schneider
@jkschneider
Apr 17 2017 21:15
ok
Mike Dalrymple
@watchwithmike
Apr 17 2017 21:15
Would this be something I should open a GitHub issue for?
Jon Schneider
@jkschneider
Apr 17 2017 21:16
i’ll take care of that, thanks