Skip to content
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

DependencyConvergence plugin fails, yet :dependencyInsight doesn't provide additional insight #13

Open
flangknecht opened this issue Oct 30, 2020 · 1 comment

Comments

@flangknecht
Copy link

flangknecht commented Oct 30, 2020

We've just added the DependencyConvergence enforcer rule to our project.
Now it fails due to dependencies not converging (good so far).
Trying to get insights into dependency resolution by running ./gradlew :neo-autoconfigure:dependencyInsight --configuration compileClasspath --dependency org.springframework.boot:spring-boot-autoconfigure

yields

* What went wrong:
A problem occurred configuring project ':neo-autoconfigure'.
> Could not resolve all dependencies for configuration ':neo-autoconfigure:compileClasspath'.
   > Conflict(s) found for the following module(s):
       - org.springframework.boot:spring-boot-autoconfigure between versions 2.3.1.RELEASE and 2.0.0.RELEASE
       - org.slf4j:slf4j-api between versions 1.7.30 and 1.7.25
       - org.springframework.boot:spring-boot between versions 2.3.1.RELEASE and 2.0.0.RELEASE
     Run with:
         --scan or
         :neo-autoconfigure:dependencyInsight --configuration compileClasspath --dependency org.springframework.boot:spring-boot-autoconfigure
     to get more insight on how to solve the conflict.

This instructs me to run gradle with the same command line I used above, not providing any further insight.

Running it with -Denforcer.enabled=false, we get the desired dependency resolution output.

We have the plugin configured like follows:

rule<DependencyConvergence> {
                enabled.set(true)
                failOnDynamicVersions.set(true)
                failOnChangingVersions.set(true)
            }
@aalmiray
Copy link
Contributor

Yes, this is a tough one as the error that appears in the console does not come from the enforcer but from Gradle when it resolves configurations. As such, there's no way the enforcer plugin can add an extra line to instruct users to skip the enforcer rule, as you have done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants