Do you list also transitive dependencies that are ...
# dependency-management
e
Do you list also transitive dependencies that are used in module? Personally, I'm a fan for this.
v
Just for the sake of listing them, or do you mean when you actually use them? I assume the latter, then yes. I'd recommend to always properly declare what you use where you use it, even if it is present transitively. That also documents which version you require and also if the lib that transitively depends on it does not anymore in a future version you already have the declaration you need. The dependency analysis gradle plugin also helps you in properly declaring your dependencies, also warning when you use transitive dependencies undeclared and so on.
👍 3
e
Ah, good clarification - API that we use in module
Updated the question
t
I would slightly nuance that though: if you're using the transitive's API solely to interact with the direct dependency's API, then I would not necessarily declare it as a direct dependency: it's just part of the API of the direct dependency, and if the direct dependency changes to eliminate the transitive then you'll have to change your code anyway.
👍 1
Easier to just declare it as a direct dependency though so you don't bother verifying that you're indeed solely using it as part of the API of that other dependency that transitively depends on it.
v
Yeah, too high risk for me to ensure that I solely use it for that API, and still I use it in my code, so it is ok imho to have it declared. Also I usually try to follow the DAGP findings as they mostly make sense except for some edge cases and I don't think it does or can differentiate that case and I'm not sure either whether it should. :-)
👍 2
thank you 1