6

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

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Dave
  • 15,639
  • 133
  • 442
  • 830
  • For anyone reaching to this question, in `maven-antrun-plugin`:`3.x` the `task` is replaced with `execution`. – azbarcea Jan 21 '21 at 19:31

1 Answers1

7

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).

Community
  • 1
  • 1
Alexander Klimetschek
  • 3,585
  • 31
  • 36