惯用Maven命令

常用Maven命令
mvn --version:显示版本号,Maven home,java 版本,java home,操作系统,编码等

maven clean:清理
maven -X clean:清理 调试模式,输出各种详细信息,如jar包的下载路径等
maven jar:生成jar包
maven war:生成war 包
maven javadoc:生成Javadoc
maven site:生成真个Doc网站To generate a components site
maven eclipse:生成Eclipse配置文件
mvn clean package:先清理,后打包(根据配置文件中的<packaging>war</packaging>属性)

mvn test:To run a component's tests
mvn package:To create a component's jar
mvn install:To install a component in your local repository
mvn -Prc package:To create the source and binary distributions for a component (and the javadoc and sources jars)

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.

mvn clean dependency:copy-dependencies package:This command will clean the project, copy dependencies, and package the project (executing all phases up to package, of course).

Maven仓库
project.properties中配置
######################################################################
# Central Maven Repository
######################################################################
maven.repo.remote=http://mycom.xxx.com/maven/

或者project.xml中配置
    <repositories>
        <repository>
            <id>mycom</id>
            <name>Maven 2 Repository on mycom</name>
            <url>http://mycom.xxx.com/maven/</url>
        </repository>
        <repository>
            <id>central</id>
            <name>Maven 2 Repository on ibibio</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>