Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I redirect maven's antrun exec command's output to stdout?

I'm using Maven 3.0.3. I have this antrun task, which uses the "exec" command ...

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                <execution>
                    <id>start-xvfb</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <echo message="Starting xvfb ..." />
                            <exec executable="Xvfb" spawn="true" failonerror="true">
                                <arg value=":0.0" />
                            </exec>
                        </tasks>
                    </configuration>
                </execution>

Although I can see the echo statement in my output, I can't see any of the executables output in standard out. What can I do to redirect it to the same place that the echo message goes to?

Thanks, - Dave

like image 720
Dave Avatar asked Dec 06 '11 17:12

Dave


1 Answers

The spawn option is the problem. See the ant exec task documentation:

If you spawn a command, its output will not be logged by ant.

Furthermore, make sure there is no output or output property present, as they will redirect the output to a property or file (see this stackoverflow question).

like image 175
Alexander Klimetschek Avatar answered Oct 20 '22 06:10

Alexander Klimetschek