How to get a list of dependencies in plugin?


(Maciek Opała) #1

How can I get a list of dependencies for a given project programmatically? For instance: I’ve a plugin, and when it’s applied I get access to project instance. How can I check using this project instance if some dependencies were already added? I know that I can access ‘dependencies’ property with ‘project’ but have no idea where to go from here…


(René Groeschke) #2

In gradle dependencies are organized in configurations. To access all dependencies for a configuration you can simply call

project.configurations.compile.allDependencies

cheers, René


(Maciek Opała) #3

Yeah, thanks! Thats is exactly what is was looking for!