In the following link I have descirbed a problem I faced with gradle but not with maven. Where the System.out.print() function struggles to work properly as expected when it is followed by a Scanner or BufferReader which takes in a System.in as an argument. Can Someone explain whether this is a bug or something else ?
I looked into this not too long ago here: Gradle Progect System.out.print("TEST") don't display on the console in IntelliJ
My conclusion was that there is a buffer somewhere between the IntelliJ output window and the Gradle tooling module. It only flushes on newlines (not even if on a call to .flush() on the stream will actually flush it).
It only happens in IntelliJ, so this is hopefully only a problem when debugging and not when actually using your application. It should work fine if you run your application directly with Java on the command line, or through Gradle without involving IntelliJ.
Thank you very much for your quick reply. I also faced the same result after flushing too. No improvement. So I was thinking about posting in the intellij forums too. The existing thread there has finally asked to post it in here (gradle forums) and it seems that we are going in circles.