Skip to content

Commit

Permalink
update documentation for intellij debug
Browse files Browse the repository at this point in the history
  • Loading branch information
HomeOfTheWizard committed Mar 24, 2024
1 parent 1ee3a4f commit c5f285c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
Binary file removed docs/assets/images/intellij_debug.PNG
Binary file not shown.
Binary file added docs/assets/images/run_config_intellij.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 25 additions & 23 deletions docs/use-cases/executionEnvs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,28 @@ If you want to debug your spring application locally, there are two ways to do t
1. In IntelliJ, you can run and debug maven goals, see [here](https://www.jetbrains.com/help/idea/run-debug-configuration-maven.html).
If you want to debug, the catch is not to let spring boot plugin to fork its JVM from the initial maven process. see [here](https://youtrack.jetbrains.com/issue/IDEA-175246)

```xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>false</fork>
</configuration>
</plugin>
```

<p><img src="../assets/images/intellij_debug.PNG"/></p>

2. Or, if you want to fork the JVM and debug only your application, you can set a remote debugger on any IDE by adding spring boot JVM args for the debugger connexion.

```xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8282</jvmArguments>
</configuration>
</plugin>
```
```xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>false</fork>
</configuration>
</plugin>
```

<p><img src="../assets/images/run_config_intellij.PNG"/></p>

A working demo project is available [here](https://github.com/HomeOfTheWizard/meeting-organiser).

2. Or, if you want to fork the JVM and debug only your application, you can set a remote debugger on any IDE by adding spring boot JVM args for the debugger connexion.

```xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8282</jvmArguments>
</configuration>
</plugin>
```

0 comments on commit c5f285c

Please sign in to comment.