How to enable `provided` option in IntelliJ IDEA for Gradle project?

IntelliJ IDEA provides an option “Include dependencies with “Provided” scope” while running an application, but it seems this option only works for the Maven project. What is the alternative setting for Gradle projects?

The java plugin in Gradle defines a configuration named compileOnly. Dependencies declared in this configuration will be on Gradle’s compile classpath, but not the runtime classpath, and they will be marked as provided in IntelliJ.