-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect version listed #123
Comments
Does it print out the dependency twice? If there are multiple versions defined (e.g. different sub-projects, buildscripts vs project) then it tries to show each upgrade independently. So you might be checking I organize my projects with a central definition, e.g. see dependency.gradle. That way I can declare it like |
I had grepped the output of gradle dependencies and it is listed a couple of times (I suspected the same thing too), but always with the same version number, 2.8.0 (ie compile, testRuntime, etc). |
If you can trim it down to a sample that I can run then I can help debug. Not sure what else would cause this. |
Note that I'm using Spring Boot, which I know pulls in other dependencies, but I would have expected to see those listed in the dependencies output? Let me see if I can trim down.. Adding a trimmed down... suspect it's the Spring Boot Gradle plugin.. not sure what else it could be... |
Can you try |
No issues there. I suspect it's due to the Spring Gradle Dependency plugin... not you BUT, according to that doco, defining the dependency in dependencies should override the default version pulled in by the Spring plugin. Going to verify it's actually overriding now... Confirmed-- the generated jar does contain 2.8.0. So it is being overridden, but gradle-versions isn't seeing that fact? |
Perhaps Ran into compatibility problems with them in #97 with an overly restrictive resolution strategy. Using |
The end result is the right version... it's just the output of gradle-versions
|
That would be the dependency chosen by the build
That would be the dependency query from the versions plugin, to discover the latest. |
Curious-- the dependency chosen by the build ends up being 2.8 though? Let me md5 the gson jar just to make sure it's not a naming issue. Verified the jar included is 2.8. So the final build is using 2.8. |
Perhaps there is a resolution strategy that runs after to |
I didn't notice you edited your previous comment to include a sample, sorry! If you follow the dependencyManagement {
dependencies {
dependency 'com.google.code.gson:gson:2.8.0'
}
} I don't know why you're observing the |
The problem appears to be due to when the Specifically in Resolver#getCurrentCoordinates(configuration), Configuration copy = configuration.copyRecursive().setTransitive(false)
LenientConfiguration lenient = copy.resolvedConfiguration.lenientConfiguration
... If I remove |
Sorry, it is not a safe change due to the |
The behaviour described here is rather surprising.
That's correct.
The dependency management plugin uses a mixture of an action that is applied to each dependency in the configuration via its resolution strategy and a I'm not sure what I can do about this. I need a hook point for when a configuration is about to be resolved as, at that point, all its dependencies are known to be in place and they can be used to override dependency management. @jklap You can avoid the problem by declaring your dependencies slightly differently. If you override the version properties that are declared in Spring Boot's bom:
And then declare your dependencies without versions:
You should get the desired behaviour:
|
I've reported this on the Gradle forum regarding the |
@jklap It sounds like 1.0.2-SNAPSHOT resolves this issue. Can you verify? |
Closing due to being resolved in gradle/gradle#1567. Thanks @wilkinsona! |
I'm trying to troubleshoot three issues with the plugin suggesting versions that are already defined in my build.grade file.
The plugin is currently outputting
And my build.gradle has:
I did a gradle dependencies and it only listed 2.8.0, no 2.7.
Any suggestions on how I can further troubleshoot?
The text was updated successfully, but these errors were encountered: