二丫讲梵 二丫讲梵
首页
  • 最佳实践
  • 迎刃而解
  • Nginx
  • Php
  • Zabbix
  • AWS
  • Prometheus
  • Grafana
  • CentOS
  • Systemd
  • Docker
  • Rancher
  • Ansible
  • Ldap
  • Gitlab
  • GitHub
  • Etcd
  • Consul
  • RabbitMQ
  • Kafka
  • MySql
  • MongoDB
  • OpenVPN
  • KVM
  • VMware
  • Other
  • ELK
  • K8S
  • LLM
  • Nexus
  • Jenkins
  • 随写编年
  • 家人物语
  • 追忆青春
  • 父亲的朋友圈
  • 电影音乐
  • 效率工具
  • 博客相关
  • Shell
  • 前端实践
  • Vue学习笔记
  • Golang学习笔记
  • Golang编程技巧
  • 学习周刊
  • Obsidian插件周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • json2go (opens new window)
    • gopher (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)

二丫讲梵

行者常至,为者常成
首页
  • 最佳实践
  • 迎刃而解
  • Nginx
  • Php
  • Zabbix
  • AWS
  • Prometheus
  • Grafana
  • CentOS
  • Systemd
  • Docker
  • Rancher
  • Ansible
  • Ldap
  • Gitlab
  • GitHub
  • Etcd
  • Consul
  • RabbitMQ
  • Kafka
  • MySql
  • MongoDB
  • OpenVPN
  • KVM
  • VMware
  • Other
  • ELK
  • K8S
  • LLM
  • Nexus
  • Jenkins
  • 随写编年
  • 家人物语
  • 追忆青春
  • 父亲的朋友圈
  • 电影音乐
  • 效率工具
  • 博客相关
  • Shell
  • 前端实践
  • Vue学习笔记
  • Golang学习笔记
  • Golang编程技巧
  • 学习周刊
  • Obsidian插件周刊
关于
友链
  • 本站索引

    • 分类
    • 标签
    • 归档
  • 本站页面

    • 导航
    • 打赏
  • 我的工具

    • 备忘录清单 (opens new window)
    • json2go (opens new window)
    • gopher (opens new window)
    • 微信MD编辑 (opens new window)
    • 国内镜像 (opens new window)
    • 出口IP查询 (opens new window)
    • 代码高亮工具 (opens new window)
  • 外站页面

    • 开往 (opens new window)
    • ldapdoc (opens new window)
    • HowToStartOpenSource (opens new window)
    • vdoing-template (opens new window)
GitHub (opens new window)
  • Nexus系列文章

    • 前言
    • nexus的安装
    • 使用nexus3配置docker私有仓库
    • 使用nexus3配置maven私有仓库
    • 使用nexus3配置npm私有仓库
    • 使用nexus3配置yum私有仓库
    • 使用nexus3配置Python私有仓库
    • 使用nexus3配置golang私有仓库
    • maven私服nexus2-14-5迁移到nexus3-7-1
    • maven上传jar包以及SNAPSHOT的一个坑
      • 1,手动上传包。
      • 2,引用 SNAPSHOT 的一个坑。
    • Gradel上传本地包的一些坑及注意点
    • go1-12与1-14之私服使用的差异与变化
    • 通过命令行往python私仓传包
    • 关于yum仓库往nexus私服传包等实践
    • 将maven本地包上传到nexus私服的实践
    • 将npm本地包上传到nexus私服的实践
    • nexus2.x升级到3.x之后仓库地址改变的问题探索
    • 关于gradle中plugins依赖未走私服导致编译失败的原因探析
  • Jenkins系列文章

  • ELK笔记

  • Kubernetes笔记

  • LLM专题

  • 系列专题
  • Nexus系列文章
二丫讲梵
2019-06-16
目录

maven上传jar包以及SNAPSHOT的一个坑

文章发布较早,内容可能过时,阅读注意甄别。

# 1,手动上传包。

之前有不少人问过 nexus 私服搭建好了之后,我该如何将一些新的外部包上传到私服当中呢,其实是非常简单的。

首先是要登录上去,然后点击 Upload,找到 maven-local将 jar 包找到选中,然后填写对应的三个定位信息即可上传。

image

在引用的时候,道理是一样的,将刚刚定义的三个定位信息写入到项目的 pom 文件当中,即可引用。

# 2,引用 SNAPSHOT 的一个坑。

前天一个开发者过来找到我,说自己通过命令行往私服上传了一个SNAPSHOT(关于快照包的概念请自行百度,这里不赘述了)包,接着就在 pom 当中引用这个包,发现总是报错,报错内容大概如下:

[ERROR] Failed to execute goal on project ishangjie-admin-service: Could not resolve dependencies for project com.ald.ishangjie:ishangjie-admin-service:jar:1.0.0: Could not find artifact com.ald.ishangjie:ishangjie-activity-service-client:jar:0.0.1-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
1
2
3
4
5
6
7

大概意思就是无法引用到。

申明

原创文章eryajf,未经授权,严禁转载,侵权必究!此乃文中随机水印,敬请读者谅解。

Copyright 二丫讲梵 (opens new window) 版权所有

后来在其他地方找到了答案:

提示

Maven 内置的插件远程仓库配置,关闭了对 SNAPSHOT 的支持,防止不稳定的构建 :::

所以解决办法最关键的是:在 maven 的 conf 目录下的 setting.xml 文件中,添加对 SNAPSHOT 的支持,将 false改为 true即可。

<snapshots>
  <enabled>true</enabled>
</snapshots>
1
2
3

现在再去进行构建,就不会报刚刚的错误了。

image

参考地址:http://t.cn/AiCnBtIR

微信 支付宝
#nexus#maven
上次更新: 2024/07/04, 22:40:37
maven私服nexus2-14-5迁移到nexus3-7-1
Gradel上传本地包的一些坑及注意点

← maven私服nexus2-14-5迁移到nexus3-7-1 Gradel上传本地包的一些坑及注意点→

最近更新
01
记录二五年五一之短暂回归家庭
05-09
02
学习周刊-总第210期-2025年第19周
05-09
03
学习周刊-总第209期-2025年第18周
05-03
更多文章>
Theme by Vdoing | Copyright © 2017-2025 | 点击查看十年之约 | 浙ICP备18057030号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式