Add jvmArguments property to maven plugin
The maven plugin now forks a new process when it starts a boot app. This makes remote debugging of the app impossible without the ability to pass extra JVM arguments. This commit adds a "jvmArguments" attribute to the RunMojo that defines additional JVM arguments to set on the forked process. Fixes gh-848
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
-----
|
||||
Debug the application
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2014-05-14
|
||||
-----
|
||||
|
||||
The <<<run>>> goal forks a process for the boot application. It is possible to specify jvm arguments
|
||||
to that forked process. The following configuration suspend the process until a debugger has joined
|
||||
on port 5005
|
||||
|
||||
---
|
||||
<project>
|
||||
...
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<jvmArguments>
|
||||
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
|
||||
</jvmArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
...
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
...
|
||||
</project>
|
||||
---
|
||||
|
||||
These arguments can be specified on the command line as well, make sure to wrap that properly,
|
||||
that is:
|
||||
|
||||
---
|
||||
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ Spring Boot Maven Plugin
|
||||
|
||||
* {{{./examples/exclude-dependency.html}Exclude a dependency}}
|
||||
|
||||
* {{{./examples/run-debug.html}Debug the application}}
|
||||
|
||||
[]
|
||||
|
||||
|
||||
|
||||
@@ -99,6 +99,10 @@ Usage
|
||||
mvn spring-boot:run
|
||||
---
|
||||
|
||||
The application is forked in a separate process. If you need to specify some JVM arguments
|
||||
(i.e. for debugging purposes), you can use the <<<jvmArguments>>> parameter, see
|
||||
{{{./examples/run-debug.html}Debug the application}} for more details.
|
||||
|
||||
By default, any <<src/main/resources>> folder will be added to the application classpath
|
||||
when you run the application. This allows hot refreshing of resources which can be very
|
||||
useful when developing web applications. For example, you can work on HTML, CSS or JavaScipt
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<menu name="Examples">
|
||||
<item name="Custom repackage classifier" href="examples/repackage-classifier.html"/>
|
||||
<item name="Exclude a dependency" href="examples/exclude-dependency.html"/>
|
||||
<item name="Debug the application" href="examples/run-debug.html"/>
|
||||
</menu>
|
||||
<menu ref="reports"/>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user