Send maven output to file

rapt picture rapt · Mar 15, 2012 · Viewed 59.7k times · Source

On Windows 7, I am trying to send the output of a maven-3 command to a text file.

I call the command from the root of the project I am trying to analyze.

The command is:

mvn dependency:tree -Dverbose -Dincludes=commons-collections -DoutputFile=C:\Users\myname\Documents\output.txt

When I run the command without the outputFile parameter, I see the output sent to the console.

But when I use it with the outputFile parameter, the output file is empty.

Any idea what I am missing here?

Answer

Andrzej Jozwik picture Andrzej Jozwik · Mar 15, 2012

Try mvn -help

 -l,--log-file <arg>  Log file to where all build output will go.                               

mvn <your parameters> --log-file log.txt