a BOM implementation platform( 'com.squareup.okhttp3:okhttp-bom:3.12.0' ) implementation('com.squareup.okhttp3:okhttp:3.12.1') { because 'Try new release' } ... }
a BOM implementation enforcedPlatform( 'com.squareup.okhttp3:okhttp-bom:3.12.0' ) // this version will be overriden by the one found in the BOM implementation 'com.squareup.okhttp3:okhttp:3.12.1' implementation 'com.squareup.okhttp3:okhttp-tls' implementation 'com.squareup.okhttp3:okhttp-urlconnection' implementation 'com.squareup.okhttp3:logging-interceptor' testImplementation 'com.squareup.okhttp3:mockwebserver' } platform(…) → enforcedPlatform(…)
a BOM implementation enforcedPlatform( 'com.squareup.okhttp3:okhttp-bom:3.12.0' ) // this version will be overriden by the one found in the BOM implementation 'com.squareup.okhttp3:okhttp:3.12.1' implementation 'com.squareup.okhttp3:okhttp-tls' implementation 'com.squareup.okhttp3:okhttp-urlconnection' implementation 'com.squareup.okhttp3:logging-interceptor' testImplementation 'com.squareup.okhttp3:mockwebserver' } okhttp-bom: 3.12.0 > okhttp: 3.12.1 implementation enforcedPlatform(…) implementation '…'
a BOM implementation enforcedPlatform( 'com.squareup.okhttp3:okhttp-bom:3.12.0' ) // this version will be overriden by the one found in the BOM implementation 'com.squareup.okhttp3:okhttp:3.12.1' implementation 'com.squareup.okhttp3:okhttp-tls' implementation 'com.squareup.okhttp3:okhttp-urlconnection' implementation 'com.squareup.okhttp3:logging-interceptor' testImplementation 'com.squareup.okhttp3:mockwebserver' } okhttp-bom: 3.12.1 > okhttp: 3.12.0 implementation enforcedPlatform(…) implementation '…'
a BOM implementation enforcedPlatform( 'com.squareup.okhttp3:okhttp-bom:3.12.0' ) // this version will be overriden by the one found in the BOM implementation 'com.squareup.okhttp3:okhttp:3.12.1' implementation 'com.squareup.okhttp3:okhttp-tls' implementation 'com.squareup.okhttp3:okhttp-urlconnection' implementation 'com.squareup.okhttp3:logging-interceptor' testImplementation 'com.squareup.okhttp3:mockwebserver' } okhttp-bom: 3.12.1 < okhttp: 3.12.0 implementation enforcedPlatform(…) implementation('…') { force = true }
// define the version of dependencies declared in the build script constraints { implementation('org.apache.httpcomponents:httpclient:4.5.3') { because 'previous versions have a bug impact' } implementation('commons-codec:commons-codec:1.11') } // define dependencies without versions implementation 'org.apache.httpcomponents:httpclient' } ref: https://docs.gradle.org/userguide/managing_transitive_dependencies.html#sec:dependency_constraints