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 ea9fdca6f3
commit 9effdf17ee
4 changed files with 13 additions and 21 deletions

View File

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

View File

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

View File

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

View File

@ -58,5 +58,5 @@ fi
cd "`dirname "$0"`"/example cd "`dirname "$0"`"/example
echo "[INFO] Running: $EXAMPLE ($EXAMPLE_CLASS $EXAMPLE_ARGS)" 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"