IntelliJ IDEA 2021.1 Help

Gradle tool window

The Gradle tool window is enabled automatically when you create or open your Gradle project. Click Gradle on the right sidebar to open the tool window. The tool window displays the Gradle linked projects, their tasks, dependencies, and all changes made to the underlying build.gradle file.

the Gradle tool window

Gradle

ItemDescription
Show option menu

Click this button to open the menu for configuring the current view and changing the tool window viewing modes. The menu items are options that you can turn on or off. An active item contains a check mark on the left side of its name.

The available options in the menu are as follows:

  • Group Modules: select this option if you want to group modules in the project.

  • Group Tasks: select this option if you want to group your tasks. For example, build tasks will be included into the build directory.

  • Show Ignored: select this option to display the ignored projects.

  • Show Toolbar: select this option to show the toolbar for your Gradle projects.

  • View ModePinned Mode, Docked Mode, Floating Mode, Split Mode - these options let you control general appearance and behavior of the tool window, see Tool Windows Viewing Modes

  • Group Tabs: deselect this option to see the views on separate tabs if more than one view is available in a tool window.

  • Move to: select this option to move the Gradle tool window to either top, left or right.

  • Resize: select this option to resize the Gradle tool window.

Hide tool windowShift+Escape

Hide the tool window Shift+Escape.

To hide all the tool windows, press Ctrl+Shift+F12.

Gradle Tasks

ItemDescription
Run ConfigurationsThis area contains a list of the last executed tasks and command types under which these tasks were executed.
TasksThis area contains a list of all available tasks.
DependenciesThis area contains a list of project dependencies.

Toolbar

ItemDescription
Re-import All Gradle ProjectsClick this button to re-import all registered Gradle projects after changes have been made to a Gradle script.
Link Gradle ProjectClick this button to link a Gradle project.
Unlink Gradle ProjetClick this button to detach an external Gradle project.
Run Gradle TaskUse this button to execute a Gradle task. When you click this icon, the Run Anything window opens. Enter a name of the task that you want to execute. To execute several tasks, enter task names using space to separate each new task.
Expand All Collapse AllUse these buttons to expand or collapse all the nodes.
Select Project Data to ImportClick this button to import a module or a data to your Gradle project via Project Data to Import dialog. It might be useful for the multi-module projects.
Toggle Offline ModeClick this button to work with Gradle projects in the offline mode. In this case Gradle will use dependencies from the cache. Gradle will not attempt to access the network to perform dependency resolution. If the required dependencies are not present in the cache, build execution will fail. Also, if the offline mode is enabled, the opening and syncing of your project might fail.
Show DependenciesClick this icon to generate the Gradle dependencies diagram.
Build Tools SettingsUse this icon to access the following settings:
  • Auto-Reload Setting: select this option to configure the reloading process of your Gradle project in the Build Tools settings dialog.

  • Gradle Settings: select this option to configure the settings of the current Gradle project in the Gradle settings dialog.

Context Menu

ItemDescription
Ope Gradle ConfigSelect this option or use a shortcut to open build.gradle file.
Re-import Gradle ProjectSelect this option to re-import the project.
Unlink Gradle ProjectSelect this option to detach an external project.
Ignore Gradle projectSelect this option to ignore/unignore the selected project.
Refresh Gradle dependenciesSelect this option to refresh dependencies for the project.
Show Dependencies / Show Dependencies popupUse these options to generate the Gradle dependencies diagram.
Tasks ActivationSelect this option to add, edit or remove an activation phase for your task. It might be useful for working with the Gradle multi-module projects.

Context Menu Commands for Gradle Tasks

CommandDescription
Run <task>Choose this command to run the selected task with the task-specific run/debug configuration.
Debug <task>Choose this command to debug the selected task with the task-specific run/debug configuration.
Create <task>Choose this command to create run/debug configuration for the selected Gradle task.
Select <task>Choose this command to activate the configuration for the selected Gradle task. If there is no existing configuration for the selected task, this option is disabled and replaced with the Create option.
Execute before Sync, Execute after SyncChoose these commands to set the respective flags for the selected task. In this case, Before Sync and After Sync comments appear next to the name of the node.
Execute before Build, Execute after BuildChoose these commands to set the respective flags for the selected task. In this case, Before Build and After Build comments appear next to the name of the node.
Execute before Rebuild, Execute after RebuildChoose these commands to set the respective flags for the selected task. In this case, Before Rebuild and After Rebuild comments appear next to the name of the node.
Assign ShortcutChoose this command to associate the selected phase with a keyboard shortcut. In this case, the comment with the shortcut appears next to the name of the node.
Last modified: 16 June 2021