---
title: "mvn命令"
author: "shicheng"
date: "2011-10-13T15:38:11Z"
tags: []
categories: ["编程语言"]
slug: "mvn"
draft: false
lastmod: "2011-10-13T15:38:11Z"
id: 1194624
url: "https://benchild.iteye.com/blog/1194624"
---

常用命令为 ：

 

             mvn archetype:create ：创建 Maven 项目

 

             mvn compile ：编译源代码

 

             mvn test-compile ：编译测试代码

 

             mvn test ： 运行应用程序中的单元测试

 

             mvn site ： 生成项目相关信息的网站

 

             mvn clean ：清除目标目录中的生成结果

 

             mvn package ： 依据项目生成 jar 文件

 

             mvn install ：在本地 Repository 中安装 jar

 

             mvn eclipse:eclipse ：生成 Eclipse 项目文件

 

生成项目

 

             建一个 JAVA 项目 ： mvn archetype:create -DgroupId=com.happyelements -DartifactId=payment-store

 

          建一个 web 项目 ： mvn archetype:create -DgroupId=com.happyelements -DartifactId=payment-store -DarchetypeArtifactId=maven-archetype-webapp

 

生成 Eclipse 项目

 

普通 Eclipse 项目执行 ： mvn eclipse:eclipse