How to log maven output to a file and without hiding console?

后端 未结 7 2090
醉梦人生
醉梦人生 2021-02-13 01:36

I want to save maven output to a file, but without loosing the output to console. Usage of tee is not an option because I run under Windows and also I do not want t

7条回答
  •  醉话见心
    2021-02-13 01:59

    Since you said you're on windows. In powershell there is the Tee-Object. I run maven as such: (note that in powershell you'll need to enclose the whole -Dexec.args in quotes).

    mvn exec:java "-Dexec.mainClass=com.proj.main" "-Dexec.args=arg0 arg1" | Tee-Object -FilePath output.log
    

提交回复
热议问题