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

Clarify on preferred way to configure conflict resolutions #158

Open
sschuberth opened this issue Aug 27, 2024 · 2 comments
Open

Clarify on preferred way to configure conflict resolutions #158

sschuberth opened this issue Aug 27, 2024 · 2 comments
Labels
documentation Improve documentation

Comments

@sschuberth
Copy link
Contributor

The docs both mention

configurations.all {
  resolutionStrategy.capabilitiesResolution {
    withCapability("javax.mail:mail") {        // Capability for which to make the decision
      select("com.sun.mail:jakarta.mail:0")    // The component to select
    }
  }
}

and

jvmDependencyConflicts {
    conflictResolution {
        // Customize resolution of capability conflicts
        select(JAVAX_ACTIVATION_API, "com.sun.activation:jakarta.activation")
    }
}

syntax. Are they semantically equivalent? Is one syntax preferable over the other?

@britter britter added the documentation Improve documentation label Sep 2, 2024
@jjohannes
Copy link
Member

I think we can improve the documentation there. Thanks for making us aware.


The first approach is Gradle core API. If you only use the detection plugin (for whatever reason), you can use that.

The second is the notation added by the resolution plugin that allows for a more compact notation with some tweaks. It's almost equivalent, but the notation also tells the resolution plugin not to register any standard strategy (which it does for most cases) so that you do not run into "weird" Gradle behavior like this one.

Bottom line:

  • If for some reason you only use the detection plugin, use the first method (the other is not available)
  • If you take the full package with the resolution plugin, use the second method

@sschuberth
Copy link
Contributor Author

Thanks for the clarification. It'd indeed be good if that explanation was in the docs as well!

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

No branches or pull requests

3 participants