NEXUS Maven管理仓库搭建

打开网站News and Notes from the makers of Nexus | Sonatype Blog 

选择菜单 Product-->Nexus Repository OSS,填写好内容后点击下载

 

选择你要下载的版本,我这里选择第3个

选择Docker 部署的话如下:

创建本地挂载目录 /docker/nexus-data

给予权限 chmod -R 777 nexus-data

运行命令 

docker run -d -p 8081:8081 --name nexus -v /docker/nexus-data:/nexus-data sonatype/nexus3

启动过程可能需要几分钟,查看日志 docker logs -f nexus

初始密码在/docker/nexus-data/admin.password  用户名为 admin

 批量导入jar脚本:

#!/bin/bash
 
# copy and run this script to the root of the repository directory containing files
# this script attempts to exclude uploading itself explicitly so the script name is important
# Get command line params
while getopts ":r:u:p:" opt; do
	case $opt in
		r) REPO_URL="$OPTARG"
		;;
		u) USERNAME="$OPTARG"
		;;
		p) PASSWORD="$OPTARG"
		;;
	esac
done
 
find . -type f -not -path './mavenimport\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml' -not -path '*/\^maven\-metadata\-deployment*\.xml' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;

在要导入jar的目录(不能在父节点目录,否则groupid会有父节点目录名称)执行以上脚本

命令如下:./import.sh -u admin -p xxx -r http://xx.xx.xx.xx:9081/repository/my_repos/

导入完成后如下图:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值