Skip to content

Commit

Permalink
Merge pull request #5801 from gastaldi/launching
Browse files Browse the repository at this point in the history
Launching command line should be copy/paste friendly
  • Loading branch information
stuartwdouglas authored Nov 27, 2019
2 parents e6e3d62 + af7c75a commit d9bc530
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.maven;

import static java.util.stream.Collectors.joining;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
Expand Down Expand Up @@ -617,14 +619,11 @@ public Set<Path> getPomFiles() {

public void run() throws Exception {
// Display the launch command line in dev mode
getLog().info("Launching JVM with command line: " + args.toString());
ProcessBuilder pb = new ProcessBuilder(args.toArray(new String[0]));
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
pb.redirectInput(ProcessBuilder.Redirect.INHERIT);
pb.directory(workingDir);
process = pb.start();

getLog().info("Launching JVM with command line: " + args.stream().collect(joining(" ")));
process = new ProcessBuilder(args)
.inheritIO()
.directory(workingDir)
.start();
//https://github.com/quarkusio/quarkus/issues/232
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
Expand Down

0 comments on commit d9bc530

Please sign in to comment.