Issue
There are no problems with the lines of code, but what is bothering me would be this pile of information that appears in the Output window. I would like to see only the result of the code, written as I marked it in red:
Solution
You are freely choosing to write to the Output window in NetBeans, where other NetBeans processes also write their output, so arguably what you want to achieve is not reasonable or prudent, and there is some output in that window which you probably cannot suppress anyway.
That said, a simple change which may help a lot is to suppress all Maven output except error messages by adding the --quiet
setting:
- Tools > Options > Java > and click the Maven tab
- Select Execution from the Categories tab, and enter
--quiet
in the Global Execution Options field. - Click Apply and OK.
That should get rid of most of the Maven output in the Output window, but note that:
- Other NetBeans processes may will still write to it.
- That
--quiet
setting is global, and will apply to all Maven projects you run within NetBeans.
An alternative approach is to direct all Maven output to a file using --log-file {filename}
in the Global Execution Options field. You can couple this with the --quiet
setting. For example: --log-file d:\temp\mvn1.txt --quiet
which will create a file named mvn1.txt which only contains your output.
Yet another possible approach is to direct your application's output to a file independently of Maven. See this answer for how to do that for simple PrintStream
ouput.
Answered By - skomisa
Answer Checked By - Mildred Charles (JavaFixing Admin)