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
Overlapping pom dependency management entries can cause a wrong dependency scope in Gradle 4.5 #4202
Comments
Related? #4171 |
@wreulicke thanks for reporting. I can reproduce this. It is a regression. Looks like |
Actually the pom We treat entries with different scopes now separately. Before, one entry would just override the other. Which could lead to information loss, if we have two entries with different scopes. See: a82cf4a I think the issue now is that we treat the entry without scope as "scope == compile", independent of whether we saw other entries or not. But we should only do that if no scope is defined at all in any entry. |
After investigating further, I think the change (a82cf4a) was a mistake. Even if we fix the case here, there are other cases where we would need to "merge" information from multiple dependency management entries to have the "correct" (i.e. mavens) behaviour. But that would mean that the behaviour changes for some cases. If we do this more involved change (I'll open a separate issue for it), then we should do it for 5.0. For now, I will revert a82cf4a for 4.6. @wreulicke is this actually blocking you from using 4.5 or is it something you "just noticed"? Can you work around it with an exclude? |
@jjohannes thanks for your comments.
blocking. But I can work around for few part. In my case, my runtime dependencies was contaminated due to this issue. In above case, I can work around. Following.
My runtime dependencies was contaminated by other dependency Do you have any solution? |
To clarify: The issue can only appears if one of the The revert of the change above will bring us back to what we had prior to 4.5: But it looks like it's worse for you than I thought. There are multiple test dependencies following this pattern - including
Note that this API is not yet finished and officially released and will change in future versions. But this way it works for 4.5 as workaround. Excluding all the dependencies as you started to do probably also work if you exclude all the ones listed above. |
We have a PR with fix (revert): #4244 |
@jjohannes thanks to your quickly support. 👍 |
Expected Behavior
I added dependency of "org.zalando:logbook-spring-boot-starter:1.5.3" into my module.
slf4j-simple and lombok is not resloved as dependencies of "logbook-spring-boot-starter" .
I seems to have no that dependency in the module
Current Behavior
In gradle 4.5, just resolved as dependencies.
But in gradle 4.4, not resolved.
Context
Steps to Reproduce (for bugs)
Next gradle task shows change of dependencies between gradle 4.4 and 4.5.
Your Environment
The text was updated successfully, but these errors were encountered: