Exclude jar in array of dependencies

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

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

Thanks, it works fine