Skip to content

Commit

Permalink
Merge pull request #547 from cescoffier/features/ensure-debug-port-is…
Browse files Browse the repository at this point in the history
…-positive

Fix #544 - ensure the debug port is positive
  • Loading branch information
stuartwdouglas authored Jan 17, 2019
2 parents 4804882 + 3241c0b commit 9918eaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public void execute() throws MojoFailureException {
} else if (!debug.toLowerCase().equals("false")) {
try {
int port = Integer.parseInt(debug);
if (port <= 0) {
throw new MojoFailureException("The specified debug port must be greater than 0");
}
args.add("-Xdebug");
args.add("-Xrunjdwp:transport=dt_socket,address=" + port + ",server=y,suspend=y");
} catch (NumberFormatException e) {
Expand Down

0 comments on commit 9918eaf

Please sign in to comment.