When I have an unused dependency declared using dependencies.create, these are not identified by the plugin:
plugins {
id 'java'
id 'nebula.lint' version '17.5.0'
}
gradleLint.rules = ['unused-dependency']
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation dependencies.create('org.springframework:spring-core:5.2.18.RELEASE')
}
$ ./gradlew clean lintGradle
> Task :lintGradle FAILED
This project contains lint violations. A complete listing of the violations follows.
Because none were serious, the build's overall status was unaffected.
warning unused-dependency this dependency is a service provider unused at compileClasspath time and can be moved to the runtimeOnly configuration (no auto-fix available)
build.gradle:16
implementation 'org.springframework:spring-core:5.2.18.RELEASE'
... etc etc ...
When I have an unused dependency declared using
dependencies.create
, these are not identified by the plugin:results in:
while declaring the same dependency using
results in:
Can
dependencies.create
be supported?