Use maven-antrun-plugin instead of exec-maven-plugin

Motivation:

exec-maven-plugin does not flush stdout and stderr, making the console
output from the examples invisible to users

Modification:

Use maven-antrun-plugin instead

Result:

A user sees the output from the examples immediately.
This commit is contained in:
Trustin Lee 2014-05-22 18:53:09 +09:00
parent cdab518562
commit 37931306d5
4 changed files with 13 additions and 21 deletions

View File

@ -292,7 +292,7 @@
<goals>
<goal>run</goal>
</goals>
<configuration>
<configuration combine.self="override">
<target>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<propertyselector property="versions" match="^(${project.groupId}:(?!netty-example)[^:]+:jar)$" select="\1" />

View File

@ -104,20 +104,17 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<executable>${java.home}/bin/java</executable>
<commandlineArgs>
${argLine.common}
${argLine.bootcp}
${argLine.leak}
${argLine.coverage}
-classpath %classpath
${argLine.example}
${exampleClass}
</commandlineArgs>
<classpathScope>runtime</classpathScope>
<target>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<propertyregex
property="mergedArgs" regexp="[\r\n\s]+" replace=" " global="true"
input="${argLine.common} ${argLine.bootcp} ${argLine.leak} ${argLine.coverage} ${argLine.example}" />
<java classname="${exampleClass}" classpathref="maven.runtime.classpath" fork="true">
<jvmarg line="${mergedArgs}"/>
</java>
</target>
</configuration>
</plugin>
</plugins>

View File

@ -857,7 +857,7 @@
<goals>
<goal>run</goal>
</goals>
<configuration>
<configuration combine.self="override">
<target>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
@ -1065,11 +1065,6 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>maven-hawtjni-plugin</artifactId>

View File

@ -58,5 +58,5 @@ fi
cd "`dirname "$0"`"/example
echo "[INFO] Running: $EXAMPLE ($EXAMPLE_CLASS $EXAMPLE_ARGS)"
exec mvn -nsu compile exec:exec -DargLine.example="$EXAMPLE_ARGS" -DexampleClass="$EXAMPLE_CLASS"
exec mvn -nsu compile antrun:run -Dcheckstyle.skip=true -Dantfile=src/antrun/run-example.xml -DargLine.example="$EXAMPLE_ARGS" -DexampleClass="$EXAMPLE_CLASS"