Why is this an issue?
Dependencies should be grouped by their destination, otherwise, it becomes hard for the reader to see which destination has what dependencies.
What is the potential impact?
Readability
This change improves readability by making it easier to see which destination has what dependencies.
How to fix it
Reorder your dependencies so that they are grouped by destination.
Code examples
Noncompliant code example
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("com.google.guava:guava:30.1.1-jre")
implementation("org.apache.commons:commons-lang3:3.9")
testImplementation(testLibs.junit.api)
testRuntimeOnly(testLibs.junit.engine)
testImplementation(testLibs.assertj.core)
testImplementation(libs.sonar.plugin.api)
implementation("log4j:log4j:1.2.17")
}
Compliant solution
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("com.google.guava:guava:30.1.1-jre")
implementation("org.apache.commons:commons-lang3:3.9")
implementation("log4j:log4j:1.2.17")
testImplementation(testLibs.junit.api)
testImplementation(testLibs.assertj.core)
testImplementation(libs.sonar.plugin.api)
testRuntimeOnly(testLibs.junit.engine)
}
Resources
Documentation