0

I am trying to exclude a nested transitive dependency from the gradle build. The dependency structure looks like

+---org.apache.beam:beam-sdks-java-core:2.33.0-custom

+---META-INF/maven/org.apache.commons/commons-compress/

enter image description here

I excluded the dependency by following the accepted solution from gradle exclude a transitive dependency but it didnt work for me.

implementation('core-lib:tag') {
    implementation('org.apache.beam:beam-sdks-java-core:2.33.0-custom') {
        exclude group: 'org.apache.commons'
    }
}

This doesnt exclude the dependency. When I change this to * the dependencies are still not excluded.

implementation('core-lib:tag') {
    implementation('org.apache.beam:beam-sdks-java-core:2.33.0-custom') {
        exclude group: '*', module:'*'
    }
}

Any suggestions on how can i exclude this dependency? Its pulling in an older version.

A_G
  • 1,964
  • 1
  • 17
  • 39

1 Answers1

0

it should be as below - optionally you can add module see https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html#sec:excluding-transitive-deps

implementation('core-lib:tag') {
    exclude group: 'org.apache.commons'
}
PrasadU
  • 1,711
  • 1
  • 8
  • 9
  • I also tried this but it removes all the dependencies of org.apache.commons from core-lib which I dont want. – A_G Apr 08 '22 at 15:26