问题
I have a gradle project which is configured and working fine in Windows environment but the same is not working when I try and run it in Mac.
Project and Environment Configuration:
Gradle 2.5/2.6
Eclipse Luna/Mars
Gradle Project using SpringBoot
The gradle project is checked out from the SVN but when I run the project as Gradle project it gives me the below error:
Configuration with name 'default' not found. Could not fetch model of type 'EclipseProject' using Gradle installation '/Users/vips/Documents/Software/gradle-2.6'.
I have downloaded and configured Gradle 2.5 and 2.6 both but I get the same error.
Again: It works fine in Windows 7, but not in Mac.
Any help here is much appreciated.
Additional Information:
I noticed that the above issue comes only for a project that is dependent on another project. For an independent gradle project, this just works fine. All dependencies are loaded.
回答1:
Mostly the reason why it happens is because new version of gradle has to be downloaded. Once you download new version of gradle, your error will go away.
http://gradle.org/downloads
回答2:
I have figured it out. In my case, somehow one of the dependent project was not checked out correctly.
I deleted that project and did a fresh checkout from SVN and it worked.
Hope this helps.
回答3:
This "could not fetch model of type..." error can be caused by a syntax error in the build.gradle file. If so, the error has nothing to do with the Gradle or Eclipse version you are running. See this question
回答4:
It can be due to Internet connectivity while trying to connect to repository.
来源:https://stackoverflow.com/questions/32029093/could-not-fetch-model-of-type-eclipseproject-using-gradle