__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"40f3f":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"40f3f":{"val":"var(--tcb-color-0)"}},"gradients":[]},"original":{"colors":{"40f3f":{"val":"rgb(127, 215, 132)","hsl":{"h":123,"s":0.52,"l":0.67,"a":1}}},"gradients":[]}}]}__CONFIG_colors_palette__

__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"40f3f":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"40f3f":{"val":"var(--tcb-color-0)"}},"gradients":[]},"original":{"colors":{"40f3f":{"val":"rgb(127, 215, 132)","hsl":{"h":123,"s":0.52,"l":0.67,"a":1}}},"gradients":[]}}]}__CONFIG_colors_palette__
Table of Contents

I run in to an issue some time back where I was required to debug a remote spring boot web application using IntelliJ and was not sure what is the best way to do it.

IntelliJ has still some issue to run Spring-boot powered web applications with Tiles and I faced same one while working on Shopizer.

We used command line to run Spring boot application using maven plugin. In this post, I will try to outline how I configured IntelliJ to debug a remote application.To debug remote spring boot application, make sure you have  “Spring Boot Maven Plugin” plugin configured in your pom.xml file

<plugins>
   ...
   <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <version>2.0.1.RELEASE</version>
   </plugin>
   ...
</plugins>

You have 2 ways to configure debug option using spring boot maven plugin

  1. configure debug option using <jvmArguments> option
  2. use command line argument
<plugins>
   ...
   <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <version>2.0.1.RELEASE</version>
      <configuration>
         <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
      </configuration>
      ...
   </plugin>
   ...
</plugins>

Alternatively, we will can pass these parameters using command line and we will go with this option in this post.

mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

By default, the run goal runs in the same process unless jvm arguments or an agent have been specified, above configuration will ensure that you are forking the process and able to debug it.

Next step is to configure IntelliJ to enable debug points, use below steps to configure it

  1. Open run/debug configuration dialogue box and click on the new iconRemote
  2. Create remote configuration , see screen shot belowJVM
  3. Click on the debug button and you are all set to debug remote spring boot applicationDebug

Make sure you have the same port number as used while starting spring boot application using Maven.

4.5 2 votes
Article Rating

Related Posts

Java Development Journal


Hello!! Welcome to the Java Development Journal. We love to share our knowledge with our readers and love to build a thriving community.

Subscribe
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
0
Would love your thoughts, please comment.x
()
x