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

后端 未结 7 2095
醉梦人生
醉梦人生 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:49

    use a tail command tail -f log_file_name in another console.

    0 讨论(0)
  • 2021-02-13 01:50

    If you are using linux. you can use the bellow command. mvn install -X | tee log.txt

    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2021-02-13 02:02

    Use Powercmd. It works as like normal command prompt plus some additional features like automatically log everything on screen, multiple windows, shortcuts.

    0 讨论(0)
  • 2021-02-13 02:05

    Use :

    > file-name

    at the end of your mvn command to send output to a file then use something like wintail to tail the file.

    0 讨论(0)
  • 2021-02-13 02:07

    As of today, maven2 does not supports this.

    0 讨论(0)
提交回复
热议问题