Reputation: 994
I'm trying to run a Gradle Task by double clicking it on Eclipse, but the task is greyed out and says "Cannot run tasks for included builds" if I right click it as you can see in the image below:
What's that supposed to mean? Suddenly I can't run tasks for no apparent reason when I was able a few hours ago.
My project is Liferay based. I'm under JDK 1.8 and Windows 10.
I tried restarting Eclipse, cleaning project, deleting .gradle folder, changing Gradle version to 4.10 and refreshing tasks but nothing changes.
Upvotes: 3
Views: 9727
Reputation: 629
Posting this in case it helps anyone. For me, this problem arose when I added a new Java project and manually converted it to gradle and then added it as a sub-project.
Doing so changed the following line in /.settings/org.eclipse.buildship.core.prefs from this:
connection.project.dir=
to this:
connection.project.dir=mynewproject
Once I changed that line back, I could run all sub-project tasks again.
Upvotes: 2
Reputation: 43
My project was set up as a Gradle multi-project. I found that the build tasks for the parent and nested projects were greyed out. The fix was to remove the Eclipse Gradle Project Nature ( Project Natures -> Gradle Project Nature) project nature on the parent project, delete the .gradle folder of the parent project and then add the Gradle Project Nature again via Eclipse.
Upvotes: 0
Reputation: 734
Please consider the following (It works fine in my case):
That did the trick ! Gradle tasks are now refreshed in green.
Upvotes: 9
Reputation: 994
I think I found a solution, in case someone's having the same problem:
Now you should be able to run Gradle Tasks again.
I hope this helps ;)
Upvotes: -1