nexus-搭建私服--踩坑记

本人把使用nexus搭建私服的过程踩坑的过程记录一下,主要包含以下问题

  • nexus安装包官网无法下载,应该被和谐了,使用把最终的下载地址使用迅雷下载,像百度网盘等离线下载不好使.迅雷就是牛.下载地址如下:
window:版本
https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.37.3-02-win64.zip
linux:版本
https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.37.3-02-unix.tar.gz
  •  相关的脚本如下:
<!-- 启动仓库服务 -->
bin/nexus run
<!-- 停止仓库服务,使用kill -9 命令 -->
<!-- 启动web服务-->
bin/nexus start
<!-- 停止web服务-->
bin/nexus stop

<!-- 访问程序网址: http://ip:端口(默认8081)/nextus(配置文件中配置,参照下图) -->
http://192.168.236.69:8081/nexus/
默认用户名:admin
密码:根据登录页面提示的文件中查找

  • 创建仓库
参照网页:
https://blog.csdn.net/u014756339/article/details/106808447
  • 创建用户:在maven配置文件中配置的是用户id和密码

  • 创建角色:

  • 本地maven配置 
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <localRepository>d:\repo_shenxi</localRepository>
    <pluginGroups>

    </pluginGroups>

    <proxies>
    </proxies>

    <servers>
        <server>
            <id>shenxi-releases</id>
            <username>deployment</username>
            <password>deployment</password>
        </server>
        <server>
            <id>shenxi-snapshot</id>
            <username>deployment</username>
            <password>deployment</password>
        </server>
    </servers>

    <mirrors>
        <mirror>
            <id>nexus</id>
            <mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
            <name>nexus repository</name>
            <url>http://192.168.236.69:30000/nexus/repository/shenxi-public/</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <repositories>
                <repository>
                    <id>nexus</id>
                    <url>http://192.168.236.69:30000/nexus/repository/shenxi-public/</url>
                    <releases>
                        <enabled>
                            true
                        </enabled>
                        <updatePolicy>
                            always
                        </updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>
                            true
                        </enabled>
                        <updatePolicy>
                            always
                        </updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>nexus</id>
                    <url>http://192.168.236.69:30000/nexus/repository/shenxi-public/</url>
                    <releases>
                        <enabled>
                            true
                        </enabled>
                        <updatePolicy>
                            always
                        </updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>
                            true
                        </enabled>
                        <updatePolicy>
                            always
                        </updatePolicy>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>nexus</activeProfile>
    </activeProfiles>
</settings>
  • 项目pom配置
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>test-mav</artifactId>
    <version>1.0-RELEASE</version>
    <dependencies>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.79</version>
        </dependency>
    </dependencies>
    <!-- 发布 -->
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <updatePolicy>always</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>nexus</id>
            <url>http://192.168.236.69:30000/nexus/repository/shenxi-public/</url>
        </pluginRepository>
    </pluginRepositories>
    <distributionManagement>
        <repository>
            <!-- id一定要和maven setting中的配置一样 -->
            <id>shenxi-releases</id>
            <url>http://192.168.236.69:30000/nexus/repository/shenxi-hosted/</url>
        </repository>
        <snapshotRepository>
            <id>shenxi-snapshot</id>
            <url>http://192.168.236.69:30000/nexus/repository/shenxi-hosted/</url>
        </snapshotRepository>
    </distributionManagement>
</project>
  • 上传本地jar包(单个)

  • 上传本地jar包(批量)
<!--参照此网页:-->
https://blog.csdn.net/lihbps/article/details/104527652

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
nexus-aliyun是指云计算服务提供商阿里云(Alibaba Cloud)的Nexus产品。Nexus是阿里云在云原生开发环境下提供的一套可靠、高效的软件仓库管理服务。Nexus-aliyun可以帮助开发者存储和管理软件包,提供私有仓库托管,使开发人员能够更方便地进行包管理和部署操作。 Nexus-aliyun具有以下几个主要的优势: 1. 可靠性:Nexus-aliyun基于阿里云的可靠、稳定的云计算基础设施提供服务,具备高可用性和数据可靠性,能够满足各种规模的企业应用需求。 2. 强大的安全性:Nexus-aliyun支持用户自定义访问控制策略,可以对软件仓库进行权限管理和访问控制,确保软件包的安全性和私密性。 3. 灵活的部署方式:Nexus-aliyun可以灵活部署在公共云、私有云或混合云环境中,适用于各种应用场景。同时,Nexus-aliyun还提供了丰富的API接口,可以与其他开发工具和CI/CD流水线进行集成,实现自动化的软件包管理和部署。 4. 丰富的功能:Nexus-aliyun提供了丰富的软件仓库管理功能,包括仓库托管、包上传、下载、搜索等功能,还支持多种软件包管理格式,例如Maven、Docker等,满足不同开发语言和应用类型的需求。 总之,Nexus-aliyun是阿里云提供的一款可靠、安全、灵活的软件仓库管理服务,能够帮助开发者更高效地管理和部署软件包,提升开发效率和应用可靠性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mengchanmian

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值