Maven命令使用及简介
2011-09-22 16:24
260 查看
mvn clean install
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
mvn -Dtest=org.apache.nutch.util.TestURLUtil test
mvn -Dtest=org.apache.nutch.util.TestURLUtil -Dmaven.surefire.debug test
创建普通应用项目:
mvn archetype:create -DgroupId=com.byread -DartifactId=blog
创建WEB项目:
mvn archetype:create -DgroupId= com.byread -DartifactId=blogweb -DarchetypeArtifactId= maven-archetype-webapp
创建appfuse 项目:
mvn archetype:create -DarchetypeGroupId =org.appfuse.archetypes -DarchetypeArtifactId =appfuse-basic-struts -DremoteRepositories =http://static.appfuse.org/releases -DarchetypeVersion =2.0.2 -DgroupId=com.mycompany.app
-DartifactId=myproject
---------------- ---------------- 命令说明---------------- ----------------
一。archetype( 内建插件,他的create任务将建立项目骨架 ): archetype:create
二。groupId 项目的java包结构:com.byread
三。artifactId 项目的名称 :blog
四。 archetypeArtifactId( 项目骨架的类型 ):
* maven-archetype-archetype
* maven-archetype-j2ee-simple
* maven-archetype-mojo
* maven-archetype-portlet
* maven-archetype-profiles (currently under development)
* maven-archetype-quickstart
* maven-archetype-simple (currently under development)
* maven-archetype-site
* maven-archetype-site-simple, and
* maven-archetype-webapp
---------------- ---------------- 其他命令说明---------------- ----------------
发布到本地:
mvn install:install -file -Dfile=D:/opensource/dbunit-2.2/dbunit-2.2.jar -DgroupId=dbunit-DartifactId=junitperf -Dversion=2.2 -Dpackaging=jar
发布到远程:
mvn deploy:deploy -file -DgroupId=staticComparison -DartifactId=static-comparison -Dversion=2.0 -Dpackaging=jar -Dfile=c:/staticComparison_2.0.jar -Durl=file:Y:\repo
生成Eclipse项目结构:
mvn eclipse:eclipse
清理(删除target目录下编译内容)
mvn clean
仅有页面文件发生变化时
mvn war:exploded
maven定义的生命周期中主要的相位如下:
validate : 验证项目是否正确以及相关信息是否可用。
compile : 编译。
test : 通过junit进行单元测试。
package : 根据事先指定的格式(比如jar),进行打包。
integration-test : 部署到运行环境中,准备进行集成测试。
verify : 对包进行有效性性和质量检查。
install : 安装到本地代码库。
deploy : 在集成或发布环境,将包发布到远程代码库。
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
mvn -Dtest=org.apache.nutch.util.TestURLUtil test
mvn -Dtest=org.apache.nutch.util.TestURLUtil -Dmaven.surefire.debug test
创建普通应用项目:
mvn archetype:create -DgroupId=com.byread -DartifactId=blog
创建WEB项目:
mvn archetype:create -DgroupId= com.byread -DartifactId=blogweb -DarchetypeArtifactId= maven-archetype-webapp
创建appfuse 项目:
mvn archetype:create -DarchetypeGroupId =org.appfuse.archetypes -DarchetypeArtifactId =appfuse-basic-struts -DremoteRepositories =http://static.appfuse.org/releases -DarchetypeVersion =2.0.2 -DgroupId=com.mycompany.app
-DartifactId=myproject
---------------- ---------------- 命令说明---------------- ----------------
一。archetype( 内建插件,他的create任务将建立项目骨架 ): archetype:create
二。groupId 项目的java包结构:com.byread
三。artifactId 项目的名称 :blog
四。 archetypeArtifactId( 项目骨架的类型 ):
* maven-archetype-archetype
* maven-archetype-j2ee-simple
* maven-archetype-mojo
* maven-archetype-portlet
* maven-archetype-profiles (currently under development)
* maven-archetype-quickstart
* maven-archetype-simple (currently under development)
* maven-archetype-site
* maven-archetype-site-simple, and
* maven-archetype-webapp
---------------- ---------------- 其他命令说明---------------- ----------------
发布到本地:
mvn install:install -file -Dfile=D:/opensource/dbunit-2.2/dbunit-2.2.jar -DgroupId=dbunit-DartifactId=junitperf -Dversion=2.2 -Dpackaging=jar
发布到远程:
mvn deploy:deploy -file -DgroupId=staticComparison -DartifactId=static-comparison -Dversion=2.0 -Dpackaging=jar -Dfile=c:/staticComparison_2.0.jar -Durl=file:Y:\repo
生成Eclipse项目结构:
mvn eclipse:eclipse
清理(删除target目录下编译内容)
mvn clean
仅有页面文件发生变化时
mvn war:exploded
maven定义的生命周期中主要的相位如下:
validate : 验证项目是否正确以及相关信息是否可用。
compile : 编译。
test : 通过junit进行单元测试。
package : 根据事先指定的格式(比如jar),进行打包。
integration-test : 部署到运行环境中,准备进行集成测试。
verify : 对包进行有效性性和质量检查。
install : 安装到本地代码库。
deploy : 在集成或发布环境,将包发布到远程代码库。
相关文章推荐
- linux下解压命令大全和 rpm命令使用简介
- Maven-01-使用maven命令出错解决方法
- DOS使用copy命令简介
- m2eclipse简单使用,创建Maven项目 ,运行mvn命令(转)
- 【项目管理和构建】——Maven简介(一)Maven是什么,以及为什么要使用Maven
- 关于系统默认JDK1.8, 但是使用Maven 的mvn -version命令时发现Java版本为其他解决办法
- tput命令使用简介
- awk命令的使用(一):简介
- 不使用IDE,用maven命令打包war项目及出现的问题解决(最全攻略,亲测有效)
- gsettings命令使用简介
- 使用Maven命令安装jar包到仓库中
- 使用maven 一行命令自动生成签名后的apk
- IDEA下使用Maven的test命令乱码
- maven的命令使用笔记
- Consul 简介、安装、常用命令的使用
- maven的命令使用笔记
- 使用Maven和WinSCP命令自动打War包上传
- HDFS 简介 和常用命令的使用
- maven 配置过程中 使用命令提示符cmd 提示 mvn 不是内部或外部命令
- Maven简介(二)——使用Maven