maven 常用命令

  1、跳过测试: -Dmaven.test.skip=true   样例:mvn clean package  -Dmaven.test.skip=true 

  2、打包:       package    样例:mvn clean package 

  3、安装包:    install        样例:mvn clean install

  4、发包:       deploy      样例: mvn clean deploy 

     发包时,同时发布源码,配置POM(如下):  

 1 <build>
 2         <plugins>
 3             <!-- 要将源码放上去,需要加入这个插件 -->
 4             <plugin>
 5                 <artifactId>maven-source-plugin</artifactId>
 6                 <version>2.1</version>
 7                 <configuration>
 8                     <attach>true</attach>
 9                 </configuration>
10                 <executions>
11                     <execution>
12                         <phase>compile</phase>
13                         <goals>
14                             <goal>jar</goal>
15                         </goals>
16                     </execution>
17                 </executions>
18             </plugin>
19         </plugins>
20     </build>

 

  

posted on 2019-04-24 16:52  苦大师  阅读(231)  评论(0编辑  收藏  举报