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命令