Excluding nested transient dependencies from WAR without having to specify provided compile

We have about 25 micro-services all of which communicate with an ESB using CXF. The dependency for this is in a library jar shared by all services. Excluding the dependencies on ‘org.apache.geronimo.specs’ in the library build.gradle does not stop the inclusion in the WARs being built, the only way to do this appears to be to add providedCompile to each WAR file. This seems flawed to me, here’s the library build.gradle I tried.

version = "0.2.0-SNAPSHOT"

configurations { provided }

sourceSets {
    main { compileClasspath += configurations.provided }
    test {
        compileClasspath += configurations.provided
        runtimeClasspath += configurations.provided
    }
}

dependencies {

    compile project(':common-exception')

    compile "commons-jxpath:commons-jxpath:$jxpathVersion"
    compile "org.slf4j:slf4j-api:$slf4jVersion"
    compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
    compile "com.google.guava:guava:$guavaVersion"
    compile "org.apache.commons:commons-lang3:$commonsLangVersion"
    compile "org.springframework:spring-core:$springVersion"
    compile "org.springframework:spring-context:$springVersion"
    compile ("org.apache.cxf:cxf-rt-frontend-jaxws:$cxfVersion") {
        exclude module:"geronimo-javamail_1.4_spec"
    }
    compile ("org.apache.cxf:cxf-rt-transports-jms:$cxfVersion") {  
        exclude module:"geronimo-geronimo-jms_1.1_spec"
    }
    provided "org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1"

    testCompile "junit:junit:$junitVersion"
    testCompile "org.slf4j:slf4j-simple:$slf4jVersion"
}