Transitive dependencies not working


i am writing a gradle plugin and transitive dependencies are not working there.

This is how i create the configuration and set transitive to true:

ConfigurationContainer configurations = project.getConfigurations();

for (Configuration configuration : configurations) {
  configuration.getResolutionStrategy().cacheChangingModulesFor(0, TimeUnit.SECONDS);

Then i add a dependency:

project.getDependencies().add("my_configuration", "Tools.Build.build_tool_testing:demo:1.0-SNAPSHOT@jar");

The pom file of the dependecy which i add in the plugin:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xsi:schemaLocation="" xmlns:xsi="">

When i execute “gradle dependencies” it is only showing “Tools.Build.build_tool_testing:demo” but not “”. Am i doing anything wrong or is there something missing?
(There is much more going on in the plugin, but i think this is the most relevant part)

Thanks a lot!

The configuration is transitive by default, even if you don’t set it to true.

Adding @jar to the end of the dependency notation specifically means you want only that JAR and no transitive dependencies for that particular dependency.

Thanks a lot! I completely missed that. Now it´s working as expected.