![]() |
One of the biggest advantages of packaging your application as a jar and using an embedded HTTP server is that you can run your application as you would any other. Debugging Spring Boot applications is also easy. You do not need any special IDE plugins or extensions.
You can run a Spring Boot application from your IDE as a simple Java application.
However, you first need to import your project. Import steps vary depending on your IDE
and build system. Most IDEs can import Maven projects directly. For example, Eclipse
users can select If you cannot directly import your project into your IDE, you may be able to generate IDE metadata by using a build plugin. Maven includes plugins for Eclipse and IDEA. Gradle offers plugins for various IDEs.
If you use the Spring Boot Maven or Gradle plugins to create an executable jar, you can
run your application using $ java -jar target/myapplication-0.0.1-SNAPSHOT.jar It is also possible to run a packaged application with remote debugging support enabled. Doing so lets you attach a debugger to your packaged application, as shown in the following example: $ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \ -jar target/myapplication-0.0.1-SNAPSHOT.jar The Spring Boot Maven plugin includes a $ mvn spring-boot:run You might also want to use the $ export MAVEN_OPTS=-Xmx1024m The Spring Boot Gradle plugin also includes a $ gradle bootRun You might also want to use the $ export JAVA_OPTS=-Xmx1024m Since Spring Boot applications are just plain Java applications, JVM hot-swapping should work out of the box. JVM hot swapping is somewhat limited with the bytecode that it can replace. For a more complete solution, JRebel can be used. The
|