The maven project initialization only generates the src/main/resources directory, but this is not enough, we have to create
src/main/java directory
src/test/java directory
src/test/resources directory
This way the project looks neater
Right-click on the project to open the properties "properties"
Select "java build path"
Choose from underlined items
Then select the directory, click create new folder to create a new folder, as shown below
Generate a folder, and then configure the output directory, because the generated folder system is identified as: the default output folder
But this will report an error or it will not work, you need to configure it yourself, select the folder, select "edit" on the right to edit, and then select the second custom output output folder, in general, the java file is placed in the class folder, and the test file is placed in under the test-class folder
The test file is placed in the test-class folder
The final generated folder effect is