Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle tasks not shown in Eclipse

Tags:

eclipse

gradle

I've a Gradle project structure and I'm using eclipse. I've installed Gradle plugin for Eclipse.

However tasks aren't shown in Gradle Tasks panel, so I'm not able to launch these ones.

project/
   build.gradle
   settings.gradle
   .project
   .classpath

I'm able to perform any task using command line.

Any ideas?

like image 459
Jordi Avatar asked Mar 08 '17 11:03

Jordi


People also ask

How do I view Gradle tasks in Eclipse?

In gradle tasks tab -> navigate to the project -> expand build folder -> right click on build -> Select Run Gradle tasks.

How do I enable tasks in Gradle?

Open the Gradle tool window. Right-click the task for which you want to create the Run configuration. From the context menu select Modify Run Configuration. In Create Run Configuration: 'task name', you can use the default settings or configure the additional options and click OK.

Where are Gradle tasks?

To see which tasks are available for our build we can run Gradle with the command-line option -t or --tasks. Gradle outputs the available tasks from our build script. By default only the tasks which are dependencies on other tasks are shown. To see all tasks we must add the command-line option --all.


Video Answer


2 Answers

I assume you are using Buildship.

The Gragle Tasks view only shows tasks having properties group and description

task myTask {
    group = 'my group'
    description = 'my description'
}

After changing your build.gradle you must 1.) gradle-refresh the project and 2.) refresh the TasksView

like image 99
Frank Neblung Avatar answered Sep 24 '22 15:09

Frank Neblung


For Eclipse 2020-03 and Eclipse Buildship 3.1.3 you can adjust the filter of your Gradle Tasks view to "Show All Tasks". Then you see your tasks which do not have a group set in the "other" section.

The task "compileJava" has no group set and is showed in the other section only if the filter "Show All Tasks" is set:

enter image description here

like image 25
Udo Avatar answered Sep 24 '22 15:09

Udo