栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

NEXUS Maven管理仓库搭建

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

NEXUS Maven管理仓库搭建

qa打开网站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

 批量导入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的目录执行以上脚本

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

导入完成后如下图:

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/513381.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号