Visual Studio Code Java JUnit Not Outputting to Console

Josh :

I am using Visual Studio Code with the java.home setting set to the directory of my JDK 11 installation. I have a Maven project and use 3.5.4 and have it added to my path, so I can run mvn in a console. Maven works as expected, as well as running the code's main method, however when I run a JUnit 4.12 test by clicking Run Test that is shown over an annotated @Test method, the test runs, however I am unable to view any console output from the JUnit tests.

Under Output, I have the Test Output window, which is where I would expect the console to output, however nothing shows up even though the test method runs System.out.println("test");

How would I go about making JUnit 4.12 display the test console output when a test is run by clicking the Run Test button shown over a test method?

Jeanne Boyarsky :

This is currently a known issue in the plugin. The workaround is to disable the Maven plugin. (You can still use the terminal within VS Code to run Maven)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=98182&siteId=1