maven命令

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值