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

Exclusions are not applied when versions are provided by constraints #340

Closed
fmck3516 opened this issue Sep 29, 2022 · 1 comment
Closed

Comments

@fmck3516
Copy link

fmck3516 commented Sep 29, 2022

Hi Spring team!

I made a observation and I'm not sure if it's a bug, or if my expectations are wrong.

Details

https://github.com/fmck3516/io.spring.dependency-management/tree/main

TLDR

The transitive dependency commons-logging is excluded when the version for core-httpclient-impl is provided directly:

dependencies {
    implementation 'com.optimizely.ab:core-httpclient-impl:3.10.2'
}

The transitive dependency commons-logging is _ NOT_ excluded when the version forcore-httpclient-impl is provided via constraint:

dependencies {
    constraints {
        implementation 'com.optimizely.ab:core-httpclient-impl:3.10.2'
    }
    implementation 'com.optimizely.ab:core-httpclient-impl'
}

My expectation is that the runtime classpath is the the same: Whether I provide the version directly or via constraint.

@wilkinsona
Copy link
Contributor

Thanks for the report. I think this is a bug. When the plugin's trying to apply Maven-style exclusions it has to copy the configurations. This copying isn't considering constraints so they're lost. As a result, an attempt is made to resolve com.optimizely.ab:core-httpclient-impl:. The lack of version causes it to fail so its pom isn't loaded and the exclusions aren't applied.

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

No branches or pull requests

3 participants