Maven tips

1.版本
mvn -version
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: D:\mvn303\bin\..
Java version: 1.6.0_10-rc2, vendor: Sun Microsystems Inc.
Java home: D:\Java\jdk1.6.0_10\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista", version: "6.1", arch: "x86", family: "windows"

2.建项目
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-

You executed the Maven goal archetype:generate, and passed in various parameters to that goal. The
prefix archetype is the plugin that contains the goal.

3.Build the Project
mvn package

4.其他命令
• validate: validate the project is correct and all necessary information is available
• compile: compile the source code of the project
• test: test the compiled source code using a suitable unit testing framework. These tests should
not require the code be packaged or deployed
• package: take the compiled code and package it in its distributable format, such as a JAR.
• integration-test: process and deploy the package if necessary into an environment where
integration tests can be run
• verify: run any checks to verify the package is valid and meets quality criteria
• install: install the package into the local repository, for use as a dependency in other projects
locally
• deploy: done in an integration or release environment, copies the final package to the remote
repository for sharing with other developers and projects.
There are two other Maven lifecycles of note beyond the default list above. They are
• clean: cleans up artifacts created by prior builds
• site: generates site documentation for this project

你可能感兴趣的:(maven)