rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/ShowMojo.java
changeset 1850 23babc7d5bb8
parent 1787 ea12a3bb4b33
     1.1 --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/ShowMojo.java	Tue Feb 24 11:12:53 2015 +0100
     1.2 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/ShowMojo.java	Sat Dec 26 08:22:59 2015 +0100
     1.3 @@ -21,6 +21,7 @@
     1.4  import org.apache.maven.plugin.AbstractMojo;
     1.5  
     1.6  import java.io.File;
     1.7 +import java.io.Flushable;
     1.8  import java.io.IOException;
     1.9  import java.net.MalformedURLException;
    1.10  import java.net.URL;
    1.11 @@ -75,7 +76,11 @@
    1.12          try {
    1.13              Closeable httpServer;
    1.14              httpServer = Launcher.showDir(launcher, directory, null, startpage);
    1.15 -            System.in.read();
    1.16 +            if (httpServer instanceof Flushable) {
    1.17 +                ((Flushable)httpServer).flush();
    1.18 +            } else {
    1.19 +                System.in.read();
    1.20 +            }
    1.21              httpServer.close();
    1.22          } catch (IOException ex) {
    1.23              throw new MojoExecutionException("Can't show the browser", ex);