nebula-plugins / gradle-lint-plugin

A pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts.
Apache License 2.0
768 stars 89 forks source link

false positives in java project #305

Open RaphaelDucay opened 4 years ago

RaphaelDucay commented 4 years ago

Hi , i tried to use your plugin in its last version : 16.8.0 The gradle version is 4.10.2, java 1.8.0_221

Added this tou my build.gradle file : `buildscript { repositories { ... } dependencies { ... classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release' } } ... apply plugin: 'nebula.lint'

gradleLint.rules += 'unused-dependency' `

when running "gradle lintGradle" I have a lot of warnings mentioning "unused dependencies" like this one : warning unused-dependency this dependency is unused and can be removed build.gradle:153 compile(group: 'org.apache.kafka', name: 'kafka_2.10', version: "${kafkaVersion}") { exclude(module: 'jmxri') exclude(module: 'jms') exclude(module: 'jmxtools') } But you can see that the dependency is in fact used and the build brake when i remove it : src/main/java/.../KafkaHelper.java import org.apache.kafka.clients.consumer.*; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; ... private KafkaConsumer<String, String> metaKafkaConsumer; ... Could you please help me fix those false positive warnings ?

Thanks in advance !

bschoenmaeckers commented 3 years ago

duplicate of #290