Search code examples
mavenwindows-7dependenciesmaven-pluginmaven-3

Send maven output to file


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?


Solution

  • Try mvn -help

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

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