---
title: "mvn命令"
author: "dxm1986"
date: "2011-09-10T10:52:55Z"
tags: []
categories: ["研发管理"]
slug: "mvn"
draft: false
lastmod: "2011-09-10T10:52:55Z"
id: 1169736
url: "https://wolfdream.iteye.com/blog/1169736"
---

### [mvn 命令](http://blog.csdn.net/fishrui/article/details/4849612 "mvn 命令")

2009-11-21 22:59 176人阅读 [评论](http://blog.csdn.net/fishrui/article/details/4849612#comments)(0) [收藏](http://blog.csdn.net/fishrui/article/details/4849612 "收藏") [举报](http://blog.csdn.net/fishrui/article/details/4849612#report "举报")

 命令：   
生成普通工程：   
mvn archetype:create -DgroupId=com.sefer.employ -DartifactId=Employ-sys -DpackageName=com.sefer.employ -Dversion=1.0 

生成web工程：   
mvn archetype:create -DgroupId=com.sefer.employ -DartifactId=employ-webapp -DpackageName=com.sefer.employ -DarchetypeArtifactId=maven-archetype-webapp 

构建一个项目站点   
mvn site 

查看项目依赖   
命令： mvn dependency:analyze 

列出项目中所有的直接和传递性依赖。   
命令： mvn  dependency:tree 

查看有效pom   
mvn help:effective-pom 

查看插件说明   
mvn help:describe xxx 

依赖包查询   
maven 仓库 ：   
http://repo1.maven.org/maven2/ 

maven 仓库搜索（对于依赖包坐标搜索）：   
http://www.mvnrepository.com 

插件：   
1\. Maven Assembly 插件   
生成一个可分发的JAR 文件,该文件包含了项目的二进制文件和所有的依赖   
命令：   
mvn install assembly:assembly 

坐标：   
&lt;plugin&gt;   
&lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;   
&lt;configuration&gt;   
&lt;descriptorRefs&gt;   
&lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;   
&lt;/descriptorRefs&gt;   
&lt;/configuration&gt;   
&lt;/plugin&gt;

 

转自:[http://blog.csdn.net/fishrui/article/details/4849612](http://blog.csdn.net/fishrui/article/details/4849612)