[GRADLE-235] NPE if a subproject is not declared right Created: 19/Sep/08  Updated: 04/Jan/13  Resolved: 21/Sep/08

Status: Resolved
Project: Gradle
Affects Version/s: 0.4
Fix Version/s: 0.5

Type: Bug
Reporter: Andreas Zingel Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


 Description   

I have following configuration
{{
D - root
F - build.gradle
F - settings.gradle
D - sub1
F - build.gradle
D - sub2
F - build.gradle
}}
The settings.gradle does not contain 'sub2' only 'sub1' I have forgotten it. If I call now gradle from the command line in sub2 I am getting the following stacktrace:
{{
java.lang.NullPointerException
at org.gradle.execution.ProjectDefaultsTaskExecuter.select(ProjectDefaultsTaskExecuter.java:36)
at org.gradle.Build.runInternal(Build.java:119)
at org.gradle.Build.run(Build.java:94)
at org.gradle.Main.main(Main.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.BootstrapMain.main(BootstrapMain.java:70)
}}

If I try it with gradle 0.3 the following is displayed:
{{
Build aborted abnormally. Run with -s option to get stacktrace. Run with -d option to get all debug info including stacktrace. Run (additionally) with -f option to get the full (very verbose) stacktrace
Exception: org.gradle.api.UnknownProjectException: Project with path :sub2 could not be found
}}
This was the right hint.


Generated at Wed Jun 30 11:25:01 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.