Common Maven commands:
1. Create a normal Java project for Maven:
MVN archetype: Create
-Dgroupid = packagename
-Dartifactid = projectname
2. Create a Maven web project:
MVN archetype: Create
-Dgroupid = packagename
-Dartifactid = webappname
-Darchetypeartifactid = Maven-Archetype-webapp
3. CompileSource code: MVN compile
4. Compile and TestCode: MVN test-compile
5. Run the test: MVN Test
6. Generate site: MVN site
7. Package: MVN package
8. Install jar: MVN install in local repository
9. Clear the generated project: MVN clean
10. Generate Eclipse project: MVN Eclipse: Eclipse
11. Create an idea project: MVN idea: idea
12. Use the goal command in combination. For example, package only and do not test: MVN-Dtest package
13. Compile the test content: MVN test-compile
14. Create a jar package: MVN jar: jar
15. Test without compiling or compiling: MVN test-skipping compile-skipping test-compile
(-The flexible use of skipping can also be used for other combined commands)
16. Clear some system settings of Eclipse: MVN Eclipse: clean
PS:
The general usage is as follows: first download the code to the local machine through CVs or SVN, then execute MVN Eclipse: eclipse to generate the ecllipse project file, and then import it to eclipse; after modifying the code, run the MVN compile or MVN test check. You can also download the eclipse Maven plug-in.
MVN-version/-V displays version information
MVN archetype: Generate create MVN Project
MVN archetype: Create-dgroupid = com. oreilly-dartifactid = My-app create MVN Project
MVN package generates the target directory, compiles and tests the code, generates the test report, and generates the JAR/war file.
MVN jetty: run the project on Jetty,
MVN compile Compilation
Compile and test MVN Test
MVN clean clears the generated file
MVN site: the website that generates project-related information
MVN-dwtpversion = 1.0 Eclipse: Eclipse generates the WTP plug-in WEB Project
MVN-dwtpversion = 1.0 Eclipse: Clean clears the configuration information of the eclipse project (WEB Project)
MVN Eclipse: Eclipse converts a project to an Eclipse project
In the ApplicationProgramUse multiple repositories
<Repositories>
<Repository>
<ID> ibiblio </ID>
<Name> ibiblio </Name>
<URL> http://www.ibiblio.org/maven/ </URL>
</Repository>
<Repository>
<ID> planetmirror </ID>
<Name> planet mirror </Name>
<URL> http://public.planetmirror.com/pub/maven/ </URL>
</Repository>
</Repositories>
MVN deploy: deploy-file-dgroupid = com-dartifactid = client-dversion = 0.1.0-dpackaging = jar-dfile = D: \ client-0.1.0.jar-drepositoryid = Maven-repository-inner-durl = ftp: // xxxxxxx/opt/Maven/Repository/
Release third-party jar files to the local database:
MVN install: Install-file-dgroupid = com-dartifactid = client-dversion = 0.1.0-dpackaging = jar-dfile = D: \ client-0.1.0.jar
-Ddownloadsources = true
-Ddownloadjavadocs = true
MVN-e displays detailed error information.
MVN validate verifies that the project is correct and that all required resources are available.
MVN test-compile: compile the project test code. .
MVN integration-test processes and releases packages in an environment where the integration test can run.
MVN verify runs any check to verify whether the package is valid and meets quality standards.
MVN generate-sources generates any additional source code required by the application, such as XDoclet.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/lifxue/archive/2009/10/14/4662902.aspx
Common commands:
MVN-V display version
MVN help: describe-dplugin = help use the describe target of the help plug-in to output the information of the maven help plug-in.
MVN help: describe-dplugin = Help-dfull use the help plug-in to output a complete target column with parameters
MVN help: describe-dplugin = compiler-dmojo = compile-dfull get the information of a single target and set the mojo and plugin parameters. This command lists all the information of the compiler plug-in's compile target
MVN help: describe-dplugin = Exec-dfull list all available targets of the maven exec plug-in
MVN help: valid-Pom view this "valid (valid) "pom, which exposes the default settings of Maven
MVN archetype: Create-dgroupid = org. sonatype. mavenbook. ch03-dartifactid = simple-dpackagename = org. sonatype. mavenbook
MVN Exec: Java-dexec. mainclass = org. sonatype. mavenbook. Weather. Main exec plug-in allows us to run this program without loading appropriate dependencies to classpath.
MVN dependency: Resolve prints the list of resolved Dependencies
MVN dependency: The Tree prints the entire dependency tree.
MVN install-X wants to view the complete dependency trace, including components that are not introduced due to conflicts or other reasons, open the debug mark of Maven to run
MVN install-dmaven. Test. Skip = true to add the maven. Test. Skip attribute to any target to skip the test.
MVN install assembly: Build Assembly Maven Assembly plug-in is a plug-in used to create a distribution package specific to your application
MVN jetty: Run calls the run target of the jetty plug-in to start the web application in the jetty servlet container.
MVN compile your project
MVN clean install Delete and re-compile
MVN hibernate3: hbm2ddl uses the hibernate3 plug-in to construct a database