How to log maven output to a file and without hidi

2019-03-25 07:44发布

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 to add a binary tee.exe to the source tree.

标签: logging maven
7条回答
祖国的老花朵
2楼-- · 2019-03-25 08:08

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

查看更多
Fickle 薄情
3楼-- · 2019-03-25 08:09

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.

查看更多
可以哭但决不认输i
4楼-- · 2019-03-25 08:11

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

查看更多
萌系小妹纸
5楼-- · 2019-03-25 08:23

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
查看更多
一夜七次
6楼-- · 2019-03-25 08:28

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

查看更多
▲ chillily
7楼-- · 2019-03-25 08:29

As of today, maven2 does not supports this.

查看更多
登录 后发表回答