NipGeihou's blog NipGeihou's blog
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档

NipGeihou

我见青山多妩媚,料青山见我应如是
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档
  • 设计模式

  • 开发规范

  • 经验分享

  • 记录

  • 快速开始

  • 笔记

  • 面试题

  • 微服务

    • 项目结构

      • 「微服务」Maven父子结构
      • Nexus(Maven私服)
        • 搭建
        • 配置国内镜像
        • 项目私有仓库配置
          • 凭证
          • 安装依赖
          • 全局
          • 项目
          • 提交依赖
        • 扩展:跳过SSL
        • 参考
    • Nacos

    • Gateway

    • OpenFeign

    • Seata

  • 踩过的坑

  • Java
  • 微服务
  • 项目结构
NipGeihou
2022-10-29
目录

Nexus(Maven私服)

# 搭建

略,本文搭建于 Kubernetes 上。

# 配置国内镜像

以阿里云镜像为例: https://maven.aliyun.com/repository/public

image-20221029193220217

如果没有设置图标,看看有没有登录。

创建一个 maven2(proxy)

image-20221029193517603

编辑 maven-public ,把 aliyun-public 加入,把 maven-central 移出

image-20221029193757880

# 项目私有仓库配置

# 凭证

如果没有开启匿名访问或需要推送依赖。

setting.xml

<server>
    <id>nexus-nipx</id>
    <username>username</username>
    <password>password</password>
</server>

id :如下面的 mirror.id 一致

# 安装依赖

# 全局

setting.xml

<mirror>
    <id>nexus-nipx</id>
    <mirrorOf>*,!jeecg,!jeecg-snapshots,!getui-nexus</mirrorOf>
    <name>Nexus nipx</name>
    <url>https://nexus.nipx.cn/repository/maven-public</url>
</mirror> 

# 项目

pom.xml

<repositories>
    <repository>
        <id>nexus-nipx</id>
        <name>Nexus nipx</name>
        <url>https://nexus.nipx.cn/repository/maven-public</url>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

注意

镜像源应使用 maven-public 而非 aliyun-public

# 提交依赖

pom.xml

<distributionManagement>
    <snapshotRepository>
        <id>nexus-nipx</id>
        <name>SNAPSHOTS</name>
        <url>https://nexus.nipx.cn/repository/maven-snapshots</url>
    </snapshotRepository>

    <repository>
        <id>nexus-nipx</id>
        <name>RELEASES</name>
        <url>https://nexus.nipx.cn/repository/maven-releases</url>
    </repository>
</distributionManagement>

id :于 mirror.id 一致

mvn deploy

# 扩展:跳过 SSL

image-20221029201440245

-Dmaven.wagon.http.ssl.insecure=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.ignore.validity.dates=true

# 参考

  • 162 - 生产实践 - 搭建 Nexus 服务器 - 安装和启动_ev_哔哩哔哩_bilibili (opens new window)
上次更新: 2024/04/16, 22:36:36
「微服务」Maven父子结构
Microservice - Nacos

← 「微服务」Maven父子结构 Microservice - Nacos→

最近更新
01
iSCSI服务搭建
05-10
02
磁盘管理与文件系统
05-02
03
网络测试 - iperf3
05-02
更多文章>
Theme by Vdoing | Copyright © 2018-2025 NipGeihou | 友情链接
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式