Merge pull request #39392 from lukasdo

* pr/39392:
  Polish "Update the Debugging Documentation of the Spring Boot Maven Plugin"
  Update the Debugging Documentation of the Spring Boot Maven Plugin

Closes gh-39392
This commit is contained in:
Moritz Halbritter 2024-02-06 13:08:18 +01:00
commit 34f6220427
4 changed files with 8 additions and 9 deletions

View File

@ -40,7 +40,7 @@ Doing so lets you attach a debugger to your packaged application, as shown in th
[source,shell,indent=0,subs="verbatim"]
----
$ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \
$ java -agentlib:jdwp=server=y,transport=dt_socket,address=8000,suspend=n \
-jar target/myapplication-0.0.1-SNAPSHOT.jar
----

View File

@ -79,11 +79,11 @@ The following configuration suspend the process until a debugger has joined on p
include::../maven/running/debug-pom.xml[tags=debug]
----
These arguments can be specified on the command line as well, make sure to wrap that properly, that is:
These arguments can be specified on the command line as well:
[indent=0]
----
$ mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
$ mvn spring-boot:run -Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
----

View File

@ -8,7 +8,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
</jvmArguments>
</configuration>
</plugin>

View File

@ -63,11 +63,10 @@ class RunArgumentsTests {
}
@Test
void parseDebugFlags() {
String[] args = parseArgs("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
assertThat(args).hasSize(2);
assertThat(args[0]).isEqualTo("-Xdebug");
assertThat(args[1]).isEqualTo("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
void parseDebugFlag() {
String[] args = parseArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005");
assertThat(args).hasSize(1);
assertThat(args[0]).isEqualTo("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005");
}
@Test