Gradle Spring dependencyManager exclude module from BOM definition
Asked Answered
C

1

7

I'm using Gradle Spring dependency-manager plugin for importing Maven BOM definition in project. And I need to exclude one module defined in BOM.

Will be nice to do something like this, but mavenBom only accept string.

dependencyManagement {
     imports {
          mavenBom ('io.spring.platform:platform-bom:1.0.1.RELEASE') {
              exclude 'com.datastax.cassandra:cassandra-driver-dse'
          }
     }
}

Is it possible to exclude specific module defined in BOM on some other way?

Coumarin answered 19/8, 2015 at 21:40 Comment(0)
M
0

The imports are only for importing boms so that we can declare dependencies without worrying about the versions

We can exclude particular dependency when actually declaring the dependency from that bom.

For your eg something like:

dependencyManagement {
         imports {
              mavenBom 'io.spring.platform:platform-bom:1.0.1.RELEASE'
         }
    
    }
    dependencies {
            compile ('org.springframework.boot:spring-boot-starter-data-cassandra'){
                exclude 'com.datastax.cassandra:cassandra-driver-core'
            }
    }
Multipartite answered 27/8, 2020 at 19:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.