From 9961cae7cf7819e853714fcf06ae0a00d8fc8d39 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 43362f4dd2..f685ee900e 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 36bd3530b1..ad5fb3bf6f 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -103,18 +103,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 2feb1aec00..436ea896c3 100644 --- a/pom.xml +++ b/pom.xml @@ -857,7 +857,7 @@ run - + @@ -1070,6 +1070,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 ed99953c55..9a188accde 100755 --- a/run-example.sh +++ b/run-example.sh @@ -91,5 +91,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"