How is the Run/Debug Configurations "Application:" dropdown populated?

Answered

The dropdown for the Application field in the Run/Debug configuration for my new Grails 7 project contains only the value [none], so I am unable to choose a valid Application, which causes this error: 

Run Configuration Error: Grails application is not selected

This has happened in the past; clicking the Sync All Gradle Projects button usually resolved it, but does not this time.

How is that dropdown populated normally?  What can I do to populate it manually?

1
1 comment

You can't add an entry to the Application list by hand. The Grails plugin fills it with the Grails applications it detects in the project. 

  1. After indexing, the plugin finds every grails-app directory in the project.
  2. The directory above grails-app must be a linked Gradle project, or a module of one.
  3. During Gradle sync, the plugin marks that module as a Grails module. For Grails 7, the module must apply an org.apache.grails.gradle.grails-* Gradle plugin (for example org.apache.grails.gradle.grails-web). The plugin must also be able to resolve org.apache.grails:grails-shell-cli using the grailsVersion property.

If step 3 fails, the Build tool window shows the warning "Grails import errors: Unable to build Grails project configuration", and the list stays at [none]. A sync reruns step 3, which is why Sync All Gradle Projects fixed this for you before. In the JetBrains builds of the plugin (261.x and older), the list also stays empty after the project opens until the next Gradle sync. Apache Grails 262.0.0 and later recompute the list when the Gradle project data finishes loading.

Please check these:

  1. Your IntelliJ IDEA version and your Grails plugin version. Open Settings | Plugins | Installed, find the Grails plugin, and note its version. Versions 261.x and older are the JetBrains build, bundled with IntelliJ IDEA 2026.1 and earlier. Versions 262.x are Apache Grails, maintained by the Apache Grails project, for IntelliJ IDEA 2026.2 and later. The current version is 262.0.1.
  2. The directory that contains grails-app is the Gradle project shown in the Gradle tool window, or one of its modules.
  3. After Sync All Gradle Projects, look for the "Grails import errors" warning in the Build tool window.

To run the app in the meantime, use the Gradle task instead of the Grails run configuration. In the Gradle tool window, expand your project and double-click Tasks | application | bootRun. Grails 7 runs on Spring Boot, so bootRun starts the same application.

If the list stays empty on the current plugin version, report it on the plugin tracker: https://github.com/apache/grails-intellij-plugin/issues. JetBrains transferred the plugin to the Apache Software Foundation, see IDEA-379825.

1

Please sign in to leave a comment.