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

Allow to exclude only some artifacts of a transitive dependency #22704

Closed
mahozad opened this issue Nov 12, 2022 · 1 comment
Closed

Allow to exclude only some artifacts of a transitive dependency #22704

mahozad opened this issue Nov 12, 2022 · 1 comment
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be in:dependency-declarations variant notation attributes capability substitution

Comments

@mahozad
Copy link
Contributor

mahozad commented Nov 12, 2022

I am using the org.bytedeco:ffmpeg-platform library which is, I think, an aggregator dependency like junit-jupiter except that junit-jupiter aggregates some separate dependencies but ffmpeg-platform aggregates some artifacts of a single dependency (org.bytedeco:ffmpeg).

The problem is, it brings many JARs that in total are about 250 MB and I don't need them all for my GUI application for one OS/architecture. How can I use the org.bytedeco:ffmpeg-platform library and exclude some of the transitive artifacts it brings?

For example, I tried to use classifiers like the following to exclude linux-x86 JAR artifact but it doesn't work:

implementation("org.bytedeco:ffmpeg-platform:5.1.2-1.5.8") {
    exclude(group = "org.bytedeco", module = "ffmpeg:linux-x86")
}

Expected Behavior

To be able to exclude some artifacts of transitive dependencies.

Current Behavior

Gradle brings all artifacts of transitive dependencies.

Context

My current solution is to not use the org.bytedeco:ffmpeg-platform aggregator dependency and use the org.bytedeco:ffmpeg directly and include my desired artifacts one by one with classifiers:

implementation("org.bytedeco:ffmpeg:5.1.2-1.5.8") // The main artifact
implementation("org.bytedeco:ffmpeg:5.1.2-1.5.8:windows-x86")     // My first desired artifact
implementation("org.bytedeco:ffmpeg:5.1.2-1.5.8:windows-x86_64") // My second desired artifact

Another example library

For another similar aggregator dependency which brings artifacts of another dependency see jna-platform which brings jna artifacts.

@mahozad mahozad added a:feature A new functionality to-triage labels Nov 12, 2022
@eskatos eskatos added closed:not-fixed Indicates the issue was not fixed and is not planned to be in:dependency-declarations variant notation attributes capability substitution and removed a:feature A new functionality to-triage labels Nov 23, 2022
@eskatos
Copy link
Member

eskatos commented Nov 23, 2022

Thank you for your interest in Gradle.

We have no plans to provide that feature in Gradle.
If you don't need all of architectures, specifying exactly the dependencies you need is the way to go.

@eskatos eskatos closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be in:dependency-declarations variant notation attributes capability substitution
Projects
None yet
Development

No branches or pull requests

2 participants