镜像下载、域名解析、时间同步请点击 阿里云开源镜像站
Nexus 是一个强大的maven仓库管理器,它极大地简化了本地内部仓库的维护和外部仓库的访问。,还可以用来创建yum、pypi、npm、docker、nuget、rubygems 等各种私有仓库。

系统设置linux中# /etc/security/limits.conf 在此文件中添加一下内容nexus - nofile 65536需要java 1.8以上环境运行
# tar -xzf jdk-8u211-linux-x64.tar.gz -C /usr/local/# vim /etc/profileexport JAVA_HOME=/usr/local/jdk1.8.0_211/export JRE_HOME=/usr/loca/jdk1.8.0_211/jreexport CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jarexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH# source /etc/profile
# wget https://download.sonatype.com/nexus/3/latest-unix.tar.gz# mkdir /opt/nexus# tar -xzf nexus-3.16.1-02-unix.tar.gz -C /opt/nexus# useradd nexus #以nexus用户运行# chown -R nexus.nexus /opt/nexusnexus解压后的两个文件nexus-xxx nexus运行需要的文件,如运行脚本、依赖jar包sonatype-work 该目录包含nexus生成的配置文件、日志文件、仓库文件等优化配置1) 配置运行用户# cd /nexus/nexus.x.x.x/bin/# vim nexus.rcrun_as_user="nexus" ----取消注释2)可以手动配置jdk的路径如果不配置的话,会使用默认的JAVA_HOME的环境变量# cd /nexus/nexus.x.x.x/bin/# vim nexusINSTALL4J_JAVA_HOME_OVERRIDE=/usr/local/jdk1.8.0_144 #第14行3)修改端口一般使用默认的端口# cd /nexus/nexusx.x.x.x/bin# vim nexus-default.properties4)配置存储及日志位置一般不做修改,使用默认# cd /nexus/nexusx.x.x.x/bin/# vim nexus.vmoptions
# sudo su - nexus# cd /opt/nexus/nexus.x.x.x/bin# ./nexus run & #后台运行# 使用web页面进行设置代理仓库http://localhost:8081

配置pypi仓库步骤:
1、建立官方代理仓库
2、填写远程索引地址时,地址:pypi.python.org/ ; mirrors.aliyun.com ; #配置多个国内的资源
3、建立hosted仓库,用于内部使用的myptpi-hosted
4、建立group仓库把官方代理配置添加进去





1、使用pip时,使用-i指定仓库地址,并同时使用—trusted-host参数指定信任主机
pip install -i http://localhost:8081/repository/pypigroup/simple/ --no-cache-dir -r requirements.txt --trusted-host
2、在配置文件中配置私服地址,配置文件地址~/.pip/pip.conf,如不存在则新增该文件。配置文件内容如下
[global]index-url=nexus.menghuanhua.com:8081/repository/df-pipy-public/simple/[install]trusted-host=nexus.menghuanhua.com

1、创建hosted类型的npm库
storage: Blob store,下拉选择前面的创建好的专用blobhosted:开发环境,运行重复发布,因此选择allow rede ploy
2、创建proxy类型的仓库
proxy:remote storage:远程仓库地址,填写:https://registry.npm.taobao.org
3、创建group类型的npm仓库
storage:选择装用的blob存储npm-hubgroup:将左边可选的2个仓库,添加到右边的members下
1、node环境2、获取默认的仓库地址# npm config get registry3、配置私服地址在nexus的web页面的repositories/group-npm中查看url4、通过一下的命令配置# npm config set registry http://x.x.x.x/repository/group-npm# npm config get reagistry5、找一个node相关的项目,安装编译# npm install
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号