From 7667a4a32e66e20106d0eac39f84c2520213b318 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 704a260df9..dea39b21cc 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -293,7 +293,7 @@ run - + diff --git a/example/pom.xml b/example/pom.xml index e5b48d5dad..f22b51c53d 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -107,18 +107,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 e1e48b348d..1a917b4b97 100644 --- a/pom.xml +++ b/pom.xml @@ -858,7 +858,7 @@ run - + @@ -1071,6 +1071,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 5ab7956d62..e827e4e44c 100755 --- a/run-example.sh +++ b/run-example.sh @@ -93,5 +93,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"