1.12 fails with NullPointerException on missing dependency


(Marcin Zajączkowski) #1

Starting from 1.12 Gradle fails with NullPointerException as a reason on missing dependency:

* What went wrong:
Could not resolve all dependencies for configuration ':testCompile'.
> Could not resolve junit:junit:4.111.
  Required by:
      info.solidsoft.gradle.pitest:gradle-pitest-plugin:0.33.1-SNAPSHOT
   > java.lang.NullPointerException (no error message)

Gradle 1.11 fails with:

* What went wrong:
Could not resolve all dependencies for configuration ':testCompile'.
> Could not find junit:junit:4.111.
  Required by:
      info.solidsoft.gradle.pitest:gradle-pitest-plugin:0.33.1-SNAPSHOT

which doesn’t suggest anything unexpected (I’ve got a bug report where the user suspected some additional bug in my plugin instead of just missing dependency).


(Peter Niederwieser) #2

Cannot reproduce. Please provide a minimal reproducible example, and post the stack trace (’–stacktrace’) as a Github Gist or similar.


(Marcin Zajączkowski) #3

Just clone my plugin from https://github.com/szpak/gradle-pitest-plugin and change JUnit version to 4.111 (or anything else which doesn’t exist) and run

gradle test --stacktrace

using Gradle 1.12.

The stacktrace: https://gist.github.com/szpak/03c36a27ac24a896a557


(Peter Niederwieser) #4

Thanks for the report. Until the NPE gets fixed, removing ‘mavenLocal()’ will solve the problem. Note that ‘mavenLocal()’ should only be used if artifacts need to be exchanged with a local Maven build.


(Marcin Zajączkowski) #5

Thanks for a tip. I use ‘mavenLocal()’ because sometimes I rebuild (and install locally) PIT from master to test latest versions.