码迷,mamicode.com
首页 > 其他好文 > 详细

maven打包的部署及使用

时间:2018-09-20 01:07:11      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:yun   跳过   编译   全球   测试   基本   class   org   groups   

maven使用与技巧
1、Pom文件介绍与基本组成

  说明:全称是Project Object Model,通俗点的话说就是要对构建的项目进模

2、maven repository 与镜像地址 

http://mvnrepository.com maven 仓库用于查找所需要pom项目

http://repo1.maven.org/maven2/ 全球总仓库1

http://repo2.maven.org/maven2/ 全球总仓库2

http://central.maven.org/maven2/ 全球总仓库3

http://maven.aliyun.com/nexus/content/groups/public/ 阿里云镜像仓库

镜像配置:

修改settings.xml 文件

1 <mirrors>
2   <mirror>
3     <id>alimaven</id>
4     <name>aliyun maven</name>
5     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>;
6     <mirrorOf>central</mirrorOf>
7   </mirror>
8   <!-- 中央仓库1 -->
9   <mirror>
10     <id>repo1</id>
11     <mirrorOf>central</mirrorOf>
12     <name>Human Readable Name for this Mirror.</name>
13     <url>http://repo1.maven.org/maven2/</url>;
14   </mirror>
15
16   <!-- 中央仓库2 -->
17   <mirror>
18     <id>repo2</id>
19     <mirrorOf>central</mirrorOf>
20     <name>Human Readable Name for this Mirror.</name>
21     <url>http://repo2.maven.org/maven2/</url>;
22   </mirror>
23 </mirrors>

mvn常用

1 mvn clean //清空class文件
2 mvn coplile //编译
3 mvn package //打包
4 mvn test //测试
5 mvn install //打包并上传至本地仓库
6 mvn deploy //上传到远程仓库
7 mvn -Dmaven.test.skip=true //跳过测试

maven打包的部署及使用

标签:yun   跳过   编译   全球   测试   基本   class   org   groups   

原文地址:http://blog.51cto.com/weimouren/2177235

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!