Skip to content

Update the Debugging Documentation of the Spring Boot Maven Plugin #39392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=n,address=*:5005
----


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ void parseEmpty() {
}

@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
Expand Down