1

I'm using NewerVersionAvailable lint check to determine newer dependencies versions. But it looks like that this check is useful only for implementation dependencies. I think we don't need to update junit anytime soon. How to disable this check for separate dependency type? It is boring to add //noinspection to each testImplementation dependency. Example given:

dependencies {

    // should warn
    implementation 'com.android.support:support-annotations:25.0.0'

    // shouldn't warn
    testImplementation 'junit:junit:4.12'
}
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
Pazonec
  • 1,549
  • 1
  • 11
  • 35

2 Answers2

2

One should better disable the check for individual dependencies, simply because then one would still be notified of any further outdated libraries:

<issue id="NewerVersionAvailable">
    <ignore regexp="junit:junit*"/>
</issue>

With such a pattern: junit:junit* one can ignore individual dependencies - and one can ignore whole dependency-groups with such a pattern: junit:*.

This still needs to be combined with //noinspection GradleDependency, because lint and the IDE's code-inspection are not the same thing.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0

You can create a configuration file for lint inside your project and add this line to it, likes below:

<lint>
   ...
   <issue id="NewerVersionAvailable" severity="ignore" />
   ...
</lint>
pirho
  • 11,565
  • 12
  • 43
  • 70
pqtuan86
  • 59
  • 1
  • 3