Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run Gradle Tasks on project

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:

Gradle error

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.

like image 633
guillefix Avatar asked Nov 30 '25 04:11

guillefix


2 Answers

Please consider the following (It works fine in my case):

  1. Delete the project on eclipse (just check delete nested projects), do not delete the project on the disk
  2. Go the the project on the disk, find and delete all .project files
  3. Re-Import Liferay workspace on eclipse (File > Import > Liferay Workspace Project) and select your project folder

That did the trick ! Gradle tasks are now refreshed in green.

like image 155
javaxiss Avatar answered Dec 02 '25 16:12

javaxiss


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.

like image 20
Carl Andersen Avatar answered Dec 02 '25 16:12

Carl Andersen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!