[GRADLE-3089] 1.12 fails with NullPointerException on missing dependency Created: 14/May/14  Updated: 05/Aug/14  Resolved: 05/Aug/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.0-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

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).



 Comments   
Comment by Gradle Forums [ 14/May/14 ]

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

Comment by Gradle Forums [ 14/May/14 ]

Just clone my plugin from [1]https://github.com/szpak/gradle-pites... 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: [2]https://gist.github.com/szpak/03c36a2...
----------------------------------------------------------------------------------------
[1] https://github.com/szpak/gradle-pitest-plugin
[2] https://gist.github.com/szpak/03c36a27ac24a896a557

Comment by Gradle Forums [ 14/May/14 ]

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.

Generated at Wed Jun 30 12:39:38 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.