From 9ab8898db15d18308fb7edeaf1f13bb311111b6b Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 23 May 2014 20:09:15 +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. --- pom.xml | 24 ++++++++++++++++-------- run-example.sh | 2 +- src/antrun/run-example.xml | 9 --------- 3 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 src/antrun/run-example.xml diff --git a/pom.xml b/pom.xml index 3913db7aad..9c4f2d5fcb 100644 --- a/pom.xml +++ b/pom.xml @@ -502,12 +502,6 @@ maven-antrun-plugin 1.7 - - - - - - write-version @@ -515,7 +509,7 @@ run - + @@ -545,7 +539,7 @@ run - + @@ -736,6 +730,20 @@ + + + kr.motd.maven + exec-maven-plugin + 1.0.0.Final + + ${java.home}/bin/java + + -classpath %classpath + ${argLine.example} + ${exampleClass} + + + diff --git a/run-example.sh b/run-example.sh index 03bbded394..8f57257c54 100755 --- a/run-example.sh +++ b/run-example.sh @@ -83,5 +83,5 @@ fi cd "`dirname "$0"`" 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" diff --git a/src/antrun/run-example.xml b/src/antrun/run-example.xml deleted file mode 100644 index faa7697fb4..0000000000 --- a/src/antrun/run-example.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - -