Maven 私服 自动上传部署(附快速镜像)
来源:互联网 发布:发信息软件 编辑:程序博客网 时间:2024/06/06 23:55
一、配置Maven的 settings.xml
nexus私服是需要登陆的(可配置免登陆),在settings.xml的配置<servers></servers>
如下:
<servers><server> <id>nexus</id> <username>admin</username><password>xxxxx</password> </server><server> <id>central</id> <username>admin</username> <password>xxxx</password> </server></servers>
二、 配置项目的 pom.xml
添加如下:
<distributionManagement> <repository> <id>nexus</id> <name>Internal Releases</name> <url>http://168.10.132.150:8081/nexus/content/repositories/thirdparty/</url> </repository> </distributionManagement>
三、其它问题
请确保 maven 私服开启了上传部署策略:
1.登录到maven私服,点击“Repositories”在右侧的列表中找到要使用的私服仓库,最右侧为仓库地址(复制这个地址,私服镜像和上传都要用到)
2.点击该仓库后,在下面找到“Configuration”标签页,找到“Deployment Policy”项,将其修改为:Allow Redeploy
3.点击最下面的“Save”保存配置即可,之后在项目根目录下运行命令:mvn deploy
mvn deploy:会自动编译、打包、上传构件到私服,整个过程一键搞定!!
附件:
经常使用的几个比较快的镜像:
<mirrors> <!-- 私服--><mirror><id>nexus</id><mirrorOf>nexus</mirrorOf><url>http://168.10.132.150:8081/nexus/content/groups/public/</url></mirror> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> <mirror> <id>ui</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://uk.maven.org/maven2/</url> </mirror> <mirror> <id>ibiblio</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </mirror><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf> </mirror><mirror><id>repo1</id><mirrorOf>central</mirrorOf><!--<mirrorOf>*</mirrorOf>--><url>https://repo1.maven.org/maven2/</url></mirror><mirror><id>sprintio</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>https://repo.spring.io/libs-snapshot/</url></mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url>http://repository.jboss.org/nexus/content/groups/public</url> </mirror> </mirrors>
0 0
- Maven 私服 自动上传部署(附快速镜像)
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- Maven快速镜像+仓库
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- maven仓库快速镜像
- maven快速镜像地址
- maven仓库快速镜像
- Maven快速镜像(大幅提高下载速度)
- 7201简体中文完美部署[附测试镜像
- maven国内快速镜像,国内maven中央仓库地址
- maven国内快速镜像,国内maven中央仓库地址
- poj 1064 Cable master(二分+贪心+分数化整数)
- 1007最大连续子集
- vim编辑器
- 多线程编程笔记
- cocos2d js接入有米广告-ios版本
- Maven 私服 自动上传部署(附快速镜像)
- spring boot启动报Unable to start EmbeddedWebApplicationContext问题解决方案
- 正确使用Android性能分析工具——TraceView
- 为什么大多服务器跑的都是Linux?
- 网卡中断与多队列
- shell常用操作命令系列:文件相关操作命令
- IOS超时的另一种做法
- 18.Comparable,Comparator比较对象大小
- 微信红包-找出数组中过半数的数字