After the maven project is created, add the resources and other folders

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"

write picture description here

Choose from underlined items

write picture description here

Then select the directory, click create new folder to create a new folder, as shown below

write picture description here


Generate a folder, and then configure the output directory, because the generated folder system is identified as: the default output folder
write picture description here
write picture description here

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

write picture description here

The test file is placed in the test-class folder

write picture description here

The final generated folder effect is

write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324747919&siteId=291194637