Directory structure Hello src ——main ————java ————resources ——test ————java ————resources pom.xml The main directory is used to store the main program. The test directory is used to store test programs. The java directory is used to store source code files. The resources directory is used to store configuration files and resource files.
Run a few basic Maven commands . Open the cmd command line, enter the root directory of the Hello project (the directory where the pom.xml file is located), execute the mvn compile command, check the root directory change , continue to enter the mvn clean command in cmd , and then check the root directory change again , enter the mvn clean compile command in cmd, check Enter the mvn test-compile command in the root directory change cmd, view the target directory change cmd enter the mvn clean test command, view the target directory change cmd enter the mvn clean package command, view the target directory change cmd enter the mvn source:jar command, view Target directory changes Note: When running Maven commands, you must enter the directory where the pom.xml file is located!