I'm always excited to take on new projects and collaborate with innovative minds.
academy@sogdo.com
https://academy.sogdo.in/
How to debug Spring Boot application with IntelliJ IDEA Community Edition
You’re running a Spring Boot app via: mvn spring-boot:run
and your breakpoints are not getting hit in IntelliJ Community Edition.
This happens because spring-boot:run by default forks a separate JVM, and IntelliJ attaches the debugger to the Maven process, not the forked process where your app actually runs.
main() class directlyYou don’t need the Ultimate Edition for this.
main() method, for example: @SpringBootApplication
mvn spring-boot:runModify your command so that it does not fork the process.
Run:
mvn spring-boot:run -Dspring-boot.run.fork=false
Now the debugger attaches to the same JVM where your Spring Boot app runs, so breakpoints work correctly.
If you still want to run via Maven or java -jar, you can start the app with remote debugging enabled:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
Then in IntelliJ:
localhost, Port = 5005.
If you prefer to start via Maven goal, you can do it inside the IntelliJ UI too:
Spring Boot (No Fork)pom.xmlspring-boot:run -Dspring-boot.run.fork=false