Exclude jar in array of dependencies

not-a-bug

(Agustino) #1

Hi All,

I have defined array of depencies as shown below and I want to exclude certain jar from hibernate dependency

project.ext {
    hibernate_version = '4.1.9'
    libs = [
        hibernate : ['org.hibernate:hibernate:$hibernate_version', 'org.hibernate:hibernate-c3p0:$hibernate_version']
    ]
}

dependencies {
    compile libs.hibernate
}

Thanks


(uklance) #2
ext.libs = [
   dep1: dependencies.create('a:b:1.0') {
      exclude 'c:d' 
   }, 
   dep2: 'e:f:2.0'
] 
dependencies {
   compile libs.dep1
   compile libs.dep2
} 

(Agustino) #3

Thanks, it works fine