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.
Please consider the following (It works fine in my case):
That did the trick ! Gradle tasks are now refreshed in green.
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.
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.
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 ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.