From 200d0fbfea5b9e6947acc57eb3e6fef791e017df Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 23 May 2014 20:03:14 +0900 Subject: [PATCH] Use a forked exec-maven-plugin instead of maven-antrun-plugin Motivation: maven-antrun-plugin does not redirect stdin, and thus it's impossible to run interactive examples such as securechat-client and telnet-client. org.codehaus.mojo:exec-maven-plugin redirects stdin, but it buffers stdout and stderr, and thus an application output is not flushed timely. Modifications: Deploy a forked version of exec-maven-plugin which flushes output buffers in a timely manner. Result: Interactive examples work. Launches faster than maven-antrun-plugin. --- all/pom.xml | 2 +- example/pom.xml | 23 +++++++++++++---------- pom.xml | 7 ++++++- run-example.sh | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index c0e103195d..48aa653733 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -286,7 +286,7 @@ run - + diff --git a/example/pom.xml b/example/pom.xml index e337c5e538..a013917e99 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -98,18 +98,21 @@ + - maven-antrun-plugin + kr.motd.maven + exec-maven-plugin - - - - - - - + ${java.home}/bin/java + + ${argLine.common} + ${argLine.bootcp} + -classpath %classpath + ${argLine.leak} + ${argLine.coverage} + ${argLine.example} + ${exampleClass} + diff --git a/pom.xml b/pom.xml index c0a48d056b..5806da13cc 100644 --- a/pom.xml +++ b/pom.xml @@ -856,7 +856,7 @@ run - + @@ -1069,6 +1069,11 @@ maven-hawtjni-plugin 1.10 + + kr.motd.maven + exec-maven-plugin + 1.0.0.Final + diff --git a/run-example.sh b/run-example.sh index 9fa4fc04fd..f757f3ee61 100755 --- a/run-example.sh +++ b/run-example.sh @@ -90,5 +90,5 @@ fi cd "`dirname "$0"`"/example echo "[INFO] Running: $EXAMPLE ($EXAMPLE_CLASS $EXAMPLE_ARGS)" -exec mvn -nsu compile antrun:run -Dcheckstyle.skip=true -Dantfile=src/antrun/run-example.xml -DargLine.example="$EXAMPLE_ARGS" -DexampleClass="$EXAMPLE_CLASS" +exec mvn -q -nsu compile exec:exec -Dcheckstyle.skip=true -DargLine.example="$EXAMPLE_ARGS" -DexampleClass="$EXAMPLE_CLASS"