Gradle - Commons-Logging vom Frühling ausschließen

Gradle - Schließen Sie die Commons-Protokollierung vom Frühling aus

Gradle-Beispiel zum Ausschließen voncommons-logging aus Spring-Frameworks.

build.gradle

    compile('org.springframework:spring-webmvc:4.2.4.RELEASE'){
        exclude group: 'commons-logging', module: 'commons-logging'
    }

Wenn Sie mehrere Spring-Abhängigkeiten haben, müssen Sie diese jeweils ausschließen

build.gradle

    compile('org.springframework:spring-webmvc:4.2.4.RELEASE'){
        exclude group: 'commons-logging', module: 'commons-logging'
    }

    compile('org.springframework:spring-test:4.2.4.RELEASE'){
        exclude group: 'commons-logging', module: 'commons-logging'
    }

Eine bessere Lösung besteht darin,commons-logging auf Projektebene auszuschließen.

build.gradle

    configurations.all {
        exclude group: "commons-logging", module: "commons-logging"
    }

    compile 'org.springframework:spring-webmvc:4.2.4.RELEASE'
    compile 'org.springframework:spring-test:4.2.4.RELEASE'