#1. I am trying to fetch transitive dependencies inside a gradle plugin . I tried to use getAllDependencies api for configuration object. But I am still unable to get transitive dependencies. Is there anything I am missing ?
Configuration.dependencies gives you the declared dependencies, i.e. what the user wrote in their build script. It does not resolve anything.
Configurationincoming.resolutionResult gives you the resolved dependency graph. There is also Configurationincoming.artifacts when you only need a flat list of artifacts and their origin.
Configuration.incoming.dependencies is just an alias for Configuration.allDependencies.
Gradle 4.6 will have much improved documentation on this in the user guide
Please note that resolving dependencies is costly, so doing this in a loop over all projects and all configurations will be a slow process. What’s your use case?
Thanks for your reply. I tried your inputs. Please help me how I can distinguish between transitive dependencies and declared/original dependencies from Configuration.incoming.dependencies ?