1. Common commands
1) create a project
MVN archetype: generate-dgroupid = com. mycompany. app-dartifactid = My-app-darchetypeartifactid = Maven-Archetype-Quickstart-dinteractivemode = false
MVN archetype: Generate fixed format
-Dgroupid: Organization ID (package name)
-Dartifactid project name
-DarchetypeartifactidSpecify Archetypeid, Maven-Archetype-Quickstart, creates a Java project; Maven-Archetype-webapp, creates a WEB Project
-dinteractivemode: whether to use interactive mode
2) CompileSource code
MVN compile
3) Compile and TestCode
MVN test-compile
4) Clear
MVN clean
5) run the test
MVN Test
6) Create and package the site directory
MVN site-deploy
7) install the output file of the current project to the local repository.
MVN install
8) Packaging
MVN package
9) Clear and then package
MVN clean package
10) compress it into a jar package
MVN jar: jar
11) generate an Eclipse project
MVN Eclipse: Eclipse
12) view help information
MVN help: Help
13) view the types of Maven Projects
MVN archetype: generate-darchetypecatalog = intrenal
2. Standard Maven project structure
Src/main/Java stores the source code of the project
Src/test/Java: store test source code
To store some configuration files, you can create another directory src/main/resource for storage, such as log4j. properties.