[GRADLE-511] trunk fails to build with 'Could not select the default project for this build' unless buildfille specified Created: 30/May/09  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.6
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Daniel Mueller Assignee: Adam Murdoch
Resolution: Fixed Votes: 1

Attachments: Text File run-dump.txt    

 Description   

I don't know if this is expected behaviour, but if it is, please change the instructions at http://www.gradle.org/build.html, it's confusing if you're trying it the first time. And just as a note, it might be my environment, but I'd like to know what creates the behaviour ('./gradlew -d clean dists' attached).


Console
 
$> ./gradlew clean dists

Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to get the full (very verbose) stacktrace.

Could not select the default project for this build. No projects in this build have project directory '/Users/dan/source/External/svn/gradle-trunk'.

BUILD FAILED

Total time: 5.436 secs



$> ./gradlew -b build.gradle clean dists
:clean
:userguideStyleSheets
:distDocs
.... <outputsnipped/>



$> svn info
Path: .
URL: http://svn.codehaus.org/gradle/gradle-core/trunk
Repository Root: http://svn.codehaus.org/gradle
Repository UUID: 004c2c75-fc45-0410-b1a2-da8352e2331b
Revision: 1549
Node Kind: directory
Schedule: normal
Last Changed Author: hans_d
Last Changed Rev: 1548
Last Changed Date: 2009-05-29 16:09:49 +0700 (Fri, 29 May 2009)



$> svn status
$>


 Comments   
Comment by Adam Murdoch [ 02/Jun/09 ]

This is not exepected behaviour. Can you run with the -i and -s command-line options? Also, what OS/Jvm are you using? Which filesystem are you using?

Comment by Daniel Mueller [ 02/Jun/09 ]

I can run with the flags you specify, but I was assuming that -d gives you pretty much everything (already attached). Including OS (MacOSX 10.5.7), JVM (Apple/Sun 1.6.0_07 Server Hotspot). Don't know about the FS in there, but that would be HFS+ (Mac OS Extended (Journaled) => case insensitive).

$> pwd
/Users/dan/Source/External/svn/gradle-trunk
$> ./gradlew -f dists
Build failed with an exception.

Could not select the default project for this build. No projects in this build have project directory '/Users/dan/source/External/svn/gradle-trunk'.

Exception is:
org.gradle.api.GradleException: Could not select the default project for this build. No projects in this build have project directory '/Users/dan/source/External/svn/gradle-trunk'.
at org.gradle.initialization.BuildLoader.attachDefaultProject(BuildLoader.java:73)
at org.gradle.initialization.BuildLoader.load(BuildLoader.java:62)
at org.gradle.Gradle.runInternal(Gradle.java:108)
at org.gradle.Gradle.run(Gradle.java:93)
at org.gradle.Main.execute(Main.java:253)
at org.gradle.Main.main(Main.java:83)
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:53)
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.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:38)
at org.gradle.wrapper.Wrapper.execute(Wrapper.java:58)
at org.gradle.wrapper.WrapperMain.main(WrapperMain.java:41)
Caused by: org.gradle.api.InvalidUserDataException: No projects in this build have project directory '/Users/dan/source/External/svn/gradle-trunk'.
at org.gradle.initialization.AbstractProjectSpec.selectProject(AbstractProjectSpec.java:45)
at org.gradle.initialization.BuildLoader.attachDefaultProject(BuildLoader.java:71)
... 17 common frames omitted

BUILD FAILED

Total time: 5.535 secs

Personal opinion: You find a file with its path, but when you compare paths as strings (map lookup?), then they are not the same.

Comment by Peter Voss [ 20/Nov/09 ]

Is there any workaround for this? I have the exact same problem on my machine. I just can't build my project anymore and I am really stuck. Could this be a problem with the cache? I think I have deleted ~/.gradle after a harddisk upgrade. This build still works on a different machine, but I am stuck on my machine.

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