開発者ドキュメント

Gradle – SpringからCommons-Loggingを除外する

Springフレームワークから `commons-logging`を除外する例を示します。

build.gradle

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

複数のSpring依存関係がある場合、それぞれを除外する必要があります

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'
    }

より良い解決策は、プロジェクトレベルで `コモンズロギング ‘を除外することです。

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'

参考文献

  1. リンク://spring-mvc/spring-mvc-logback-slf4j-example/[Spring MVC

ログバックSLF4jの例]。リンク://gradle/gradle-display-project-dependency/[Gradle – 表示

プロジェクトの依存関係]

モバイルバージョンを終了