-
Notifications
You must be signed in to change notification settings - Fork 200
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
Conflict with "force" feature with dependencies #265
Comments
Hi @javajon, Since we let Gradle perform the heavy lifting, our flow is to clone the source configuration and rewrite the dependencies to be dynamic, and compare the results. I'm not sure if there is a global flag for us to set in this regard. Instead, you could follow the tricks in #194. That discusses the options of |
Hi @ben-manes, I was thinking the same that having some conditional around the force may also do the trick. The suggestion in #194 led me to this solution that fixes the issue:
However, others may not realize this is happening and even with force would assume this plugin would still be reaching out to find recent versions. Perhaps at least in the output and/or in the report, there could be a note to the reader that force is being used and therefore may affect the reporting outcome. Relying on Gradle for the heaving lifting is smart and it helps with compatibility as Gradle evolves. Perhaps consider a warning message for those who may not realize how the presence of force has on this plugin's behavior. Perhaps just a note in the readme. Thanks for the quick help and such a great plugin! |
Sure, do you mind sending a PR with a short suggestion? |
Happy to help. What are your preferences to these considered proposals?
Choice 1 is the least invasive and covers 80% of the problem. |
I think (1) is best, too. Since Gradle is a big API, we'd have to query it to determine upfront if there were restrictions, as I don't believe there is a way to get feedback per dependency. This could mean that restrictions (such as those applied dynamically by other plugins) may not be detectable and it would be a losing battle. For completeness (in case we someone disagrees and we do want to explore code changes) the approach would probably be to,
|
@ben-manes How about a note in the documentation, but properly handling dependency version When I disable this behavior when Is there any way |
I'm not sure, but you are welcome to poke around. The main file of interest is Resolver.groovy which determines the dependency status for a given project's configuration. This is called for every configuration in all projects, aggregated, and reported on. If you can obtain the results you want it would be done here. A local file, e.g. |
You gave me an idea, and actually if I force version to |
For idempotency of our builds, reporting, and problems with transitive dependency hell we like to force the explicit jar versions in our classpath. With failOnVersionConflict() enabled our builds break intentionally when there are discovered version conflicts. It's a very helpful Gradle feature.
The dependencyUpdates task will not report dependency updates when the force command is used. We have an explicit list of forced jars in our Gradle dependencies and we force all versions with this technique:
As a result, the gradle-versions-plugin respects this "force" command by not reporting the potential new updates. e.g we forced the guava jar to version 19 with the force it does not report that v27 is available. Removing the force allows us to us to see the updates. However, we need the force on normally.
Would you consider these two feature suggestions:
The text was updated successfully, but these errors were encountered: