IntelliJ IDEA 2020.2 Help

Run/Debug Configuration: Spring Boot

This page describes controls. For more information on how to work with Spring Boot in IntelliJ IDEA, refer to Spring Boot.

Configuration tab

Main classSpecify the fully qualified name of the class that will be executed (passed to the JRE).
Environment
VM options

If necessary, specify the command-line options to be passed to the server JVM at the server start.

  • Use spaces to separate options, for example, -client -ea -Xmx1024m.

  • If an option includes spaces, enclose the spaces or the argument itself in double quotes, for example, some" "arg or "some arg".

  • If an option includes double quotes as part of the argument, escape the double quotes using backslashes, for example, -Dmy.prop=\"quoted_value\".

  • You can pass environment variable values to custom Java properties. For example, if you define a variable MY_ENV_VAR, you can pass it to the foo property:

    -Dfoo=${MY_ENV_VAR}

Program arguments Specify arguments to be passed to the program in the format that you use in the command line. Use the same rules as for specifying the VM options.
Working directory If necessary, specify a directory that will be used by the running application. This directory is the starting point for all relative input and output paths. The project directory is specified by default.
Environment variablesClick Browse to create variables and specify their values.
Use classpath of moduleSelect the module whose classpath will be used to run the application.
Include dependencies with 'Provided' scopeEnable this option to add dependencies with the Provided scope to the runtime classpath.
JRE By default, the newest JDK from the module dependencies is used to run applications. You can specify an alternative JDK or JRE.
Shorten command line

Select a method that will be used to shorten the command line if the classpath gets too long or you have many VM arguments that exceed your OS command line length limitation:

  • none: IntelliJ IDEA will not shorten a long classpath. If the command line exceeds the OS limitation, IntelliJ IDEA will be unable to run your application and will display a message suggesting you to specify the shortening method.

  • JAR manifest: IntelliJ IDEA will pass a long classpath via a temporary classpath.jar. The original classpath is defined in the manifest file as a class-path attribute in classpath.jar. Note that you will be able to preview the full command line if it was shortened using this method, not just the classpath of the temporary classpath.jar.

  • classpath.file: IntelliJ IDEA will write a long classpath into a text file.

  • User-local default: this legacy option is set automatically for projects created before IntelliJ IDEA version 2017.3. IntelliJ IDEA will configure this setting depending on the properties set in the ide/workspace.xml and idea.config.path/options/options.xml files.

Spring Boot
Enable debug outputEnables logging of the debug output by adding the -Ddebug VM option.
Hide banner Hides the Spring Boot startup banner by adding the -Dspring.main.banner-mode=OFF VM option (for Spring Boot 1.4.x and earlier, the option is -Dspring.main.banner=false).
Enable launch optimization Select this option to speed up application launch. The -XX:TieredStopAtLevel=1 and -noverify VM options will be added.
Enable JMX agent

Enables JMX agent that shows application endpoints data by adding the following VM options (requires Spring Boot 1.3.0 or later):

  • -Dcom.sun.management.jmxremote
  • -Dspring.jmx.enabled=true
  • -DSpring.liveBeansView.mbeanDomain
  • -Dspring.application.admin.enabled=true

IntelliJ IDEA uses local JMX connector for retrieving Spring Boot actuator endpoint's data. However, it is impossible to get local JMX connector address if Spring Boot application and IntelliJ IDEA JVMs have different bitness and you are using OpenJ9 JDK. In this case, add the following lines to VM options:

  • -Dcom.sun.management.jmxremote.port={some_port}
  • -Dcom.sun.management.jmxremote.authenticate=false
  • -Dcom.sun.management.jmxremote.ssl=false
On 'Update' action

Specify an action that the IDE will do after you click Update <application name> Application:

  • Update resources — compile all modified and dependent resource files.

  • Update classes and resources — compile all modified and dependent files.

  • Update trigger file — update the trigger file. Set up the trigger filename by adding the -Dspring VM option.

  • Hot swap classes and update trigger file if failed — (available only in the debug mode) compile all modified and dependent files, hot swap classes, update the trigger file if the hot swap failed. Specify the trigger filename by adding the
    -Dspring.devtools.restart.trigger-file=.restartTriggerFile VM option.

On frame deactivation

Specify an action that the IDE will do after you switch to another application (other than IntelliJ IDEA):

  • Update resources — compile all modified and dependent resource files.

  • Update classes and resources — compile all modified and dependent files.

Active profiles Specify active Spring profiles that you want to use in this run/debug configuration.
Override parameters Use this table to specify Spring Boot configuration parameters that you want to override. Such parameters are normally defined in configuration files. Listing them in a run/debug configuration allows you to easily switch parameters by modifying the run/debug configuration instead of config files, or have multiple run/debug configurations with different parameter values.

Code Coverage tab

Use this tab to configure code coverage monitoring options.

Choose coverage runner

Select the desired code coverage runner.

By default, IntelliJ IDEA uses its own coverage engine with the Sampling mode. You can also choose JaCoCo or Emma for calculating coverage.

SamplingSelect this option to measure code coverage with minimal slow-down.
TracingSelect this option to collect accurate branch coverage. This mode is available for the IntelliJ IDEA code coverage runner only.
Track per test coverageSelect this checkbox to detect lines covered by one test and all tests covering line.
Packages and classes to record code coverage dataClick the Add class button and the Add Package button buttons to specify classes and packages to be measured. You can also remove classes and packages from the list by selecting them in the list and clicking the Remove button.
Enable coverage in test foldersIf this checkbox is selected, folders marked as test the Test Root icon are included in the code coverage analysis.

Logs tab

Use this tab to specify which log files generated while running or debugging must be displayed in the console of the Run/Debug tool window.

Log files to be shown in consoleIn this table, specify a file or a group of files that will be displayed in the Run/Debug tool window.
Save console output to fileSave console output to the specified location.
Show console when a message is printed to standard output streamEnable the output console and bring it forward if the associated process is writing to Standard.out.
Show console when a message is printed to standard error streamEnable the output console and bring it forward if the associated process is writing to Standard.err.

Before launch options

Use this section to specify which tasks must be carried out before starting the run/debug session. The tasks you specify will be performed in the order that they appear in the list.

Show this pageThis option shows the run/debug settings before starting a run/debug session.
Activate tool windowSelect the checkbox to open the Run/Debug tool window once you run the session.
Last modified: 19 August 2020