---
title: "Maven 的一些简单命令"
author: "qqdwll"
date: "2011-06-21T22:39:54Z"
tags: ["Apache", "Eclipse", "Web", "XML", "maven"]
categories: ["编程语言"]
slug: "maven"
draft: false
lastmod: "2011-06-21T22:39:54Z"
id: 1100310
url: "https://qqdwll.iteye.com/blog/1100310"
---

mvn pom.xml文件配置详解 \[url]http://maven.apache.org/ref/2.0.8/maven-model/maven.html\[/url] mvn -version/-v 显示版本信息 mvn archetype:generate 创建mvn项目 mvn archetype:create -DgroupId=com.oreilly -DartifactId=my-app 创建mvn项目 mvn package 生成target目录，编译、测试代码，生成测试报告，生成jar/war文件 mvn jetty:run 运行项目于jetty上, mvn compile 编译 mvn test 编译并测试 mvn clean 清空生成的文件 mvn site 生成项目相关信息的网站 mvn -Dwtpversion=1.0 eclipse:eclipse 生成Wtp插件的Web项目 mvn -Dwtpversion=1.0 eclipse:clean 清除Eclipse项目的配置信息(Web项目) mvn eclipse:eclipse 将项目转化为Eclipse项目 在应用程序用使用多个存储库 Ibiblio Ibiblio http://www.ibiblio.org/maven/ PlanetMirror Planet Mirror http://public.planetmirror.com/pub/maven/ 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/ 发布第三方Jar到本地库中： 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 显示详细错误 信息. mvn validate 验证工程是否正确，所有需要的资源是否可用。 mvn test-compile 编译项目测试代码。 。 mvn integration-test 在集成测试可以运行的环境中处理和发布包。 mvn verify 运行任何检查，验证包是否有效且达到质量标准。 mvn generate-sources 产生应用需要的任何额外的源代码，如xdoclet。