首页 > 其他 > 详细

MAVEN命令不断完善中。。。

时间:2016-02-16 02:01:15      阅读:302      评论:0      收藏:0      [点我收藏+]

MAVEN命令不断完善中。。。

MAVEN命令
http://www.mvnrepository.com  #中央仓库

mvn eclipse:eclipse  #生成eclipse配置文件
mvn clean package #打包项目
mvn clean install #安装成本地库
mvn clean install -DoutputDirectory=lib -Dsilent=true -Pmodules
mvn clean install -Pmodules #安装指定的模块到本地仓库
mvn jetty:run #运行jetty
mvn tomcat7:run #运行tomcat




mvn compile #编译
mvn test #运行测试




下载源码和文档
mvn -DdownloadJavadocs=true eclipse:eclipse
mvn -DdownloadSources=true eclipse:eclipse
mvn archetype:generate -DgroupId=cn.ourwill.maven -DartifactId=hello-world -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false   #mvn 创建项目

mvn install -Dmaven.test.skip=true#不执行测试




环境分离
<profiles>
        <profile>
            <id>mine</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <filters>
                    <filter>src/main/filters/filter-mine.properties</filter>
                </filters>
            </build>
        </profile>
        <profile>
            <id>test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <filters>
                    <filter>src/main/filters/filter-test.properties</filter>
                </filters>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <filters>
                    <filter>src/main/filters/filter-release.properties</filter>
                </filters>
            </build>
        </profile>
    </profiles>

mvn install -Denvironment.type=prod  #使用不同的环境,生产环境,开发环境,测试环境  

mvn install:install-file -Dfile=Sample.jar -DgroupId=uniquesample -DartifactId=sample_jar -Dversion=2.1.3b2 -Dpackaging=jar -DgeneratePom=true  #安装到本地

mvn dependency:tree #依赖树
mvn dependencies: copy-dependency #复制依赖的jar包



生成java-doc
mvn javadoc:javadoc
mvn javadoc:jar
mvn javadoc:aggregate
mvn javadoc:aggregate-jar
mvn javadoc:test-javadoc
mvn javadoc:test-jar
mvn javadoc:test-aggregate
mvn javadoc:test-aggregate-jar



生成jar
mvn jar:jar
mvn jar:test-jar



说明文档
1. mvn help:describe -Dplugin=eclipse -Dfull > eclipse-help.txt
2. mvn help:describe -Dplugin=help -Dfull > help-help.txt
3. mvn help:describe -Dplugin=dependency -Dfull > dependency-help.txt
4. mvn help:describe -Dcmd=compiler:compile –Ddetail
5. mvn help:describe -Dplugin=org.apache.maven.plugins:maven-compiler-plugin

GRADLE命令

MAVEN命令不断完善中。。。

原文:http://www.blogjava.net/nkjava/archive/2016/02/15/429325.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!