MAVEN命令不斷完善中。。。
MAVEN命令
GRADLE命令
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
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命令
posted on 2016-02-15 17:13 草原上的駱駝 閱讀(1142) 評論(0) 編輯 收藏 所屬分類: JAVA框架