mautrok
mautrok

Reputation: 961

Gradle dependency with transitive false continue to retrieve dependency

I have a build with a dependency declared this way

compile ("org:module:+"){
    changing=true
    transitive=false
}

but even if the transitive is false i still found some dependencies packages inside my build. In the build output with debug option turned on i find this messages

[org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency org:module:1.21(compile) -> commons-beanutils:commons-beanutils:1.8.0(compile,runtime)
12:19:32.773 [DEBUG] [io.spring.gradle.dependencymanagement.DependencyManagementPlugin] Processing dependency 'commons-beanutils:commons-beanutils:1.8.0'
12:19:32.774 [DEBUG] [io.spring.gradle.dependencymanagement.DependencyManagementPlugin] No dependency management for dependency 'commons-beanutils:commons-beanutils:1.8.0'
12:19:32.774 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Selecting new module version commons-beanutils:commons-beanutils:1.8.0

and much more about other module dependencies. What I have to do to force to explicitly NOT retrieve this packages?

Upvotes: 0

Views: 1544

Answers (1)

MartinTeeVarga
MartinTeeVarga

Reputation: 10908

As you have already found out, it was another dependency which had the same transitive dependency. However this should not be hard to find. You can run Gradle built-in task dependencies to get a tree view of all your dependencies.

Just for completeness, you can exclude all unwanted dependencies by:

configurations {
    all*.exclude group: 'com.example', module: 'dep'
}

Upvotes: 1

Related Questions