excluding modules from dependency resolution

58 views
Skip to first unread message

Szczepan Faber

unread,
Dec 22, 2014, 7:10:15 AM12/22/14
to gradl...@googlegroups.com
Hey guys,

The excludes at the configuration/dependency level have following behavior:

a. they propagate to the generated ivy files

b. they are inherited in a way they cannot be overridden. For example:
if I exclude module X in configuration "compile", module X is also
excluded from "testRuntime" even if I explicitly configure X as direct
dependency of "testRuntime". This behavior seems counter-intuitive but
I respect if there're good reasons that I don't know about :)

I was thinking that some use cases related to excluding modules would
be cleaner to satisfy if there was a different way to exclude modules.
For example, DependencyResolveDetails#exclude()

Thoughts?
Cheers!
--
Szczepan Faber
Core dev@gradle; Founder@mockito

Adam Murdoch

unread,
Dec 28, 2014, 4:18:29 PM12/28/14
to gradl...@googlegroups.com
Excludes are used for a bunch of use cases, and I’d like to have solutions that describe why the dependency is not required. For example:

- Improving the declarative module history stuff (aka ‘replacements') to deal with modules splitting and merging over time.
- A way to declare that a given module provides some other module(s), so that conflict resolution can take this into account and exclude the conflicting modules. This would be used, for example, to model fat jars or modules that implement some API.
- A way to modify the meta-data of a module. The would be used, for example, to model the case where some dependency is declared by the module but not actually required, or more generally to tweak the dependencies of a module.
- A way to declare compatibility between various things, so that dependency resolution can select a better version of a module.

Having said  that, some low level hooks would be useful. Currently, `DependencyResolveDetails` allows a single dependency edge to be replaced with some other edge. We could perhaps expand this to allow replacement with 0 or more edges.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
CTO Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Szczepan Faber

unread,
Dec 28, 2014, 5:49:27 PM12/28/14
to gradl...@googlegroups.com
Thanks a lot for feedback!
> --
> You received this message because you are subscribed to the Google Groups
> "gradle-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gradle-dev+...@googlegroups.com.
> To post to this group, send email to gradl...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gradle-dev/951F1A69-A52B-4FEF-B8E3-D3CA632E5ACF%40gradleware.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages