maven jar包 私服 拉去问题,加载jar包时报错ReasonPhrase:unauthorized
当我们的项目开发完成以后,可能要进行发布(如果是独立的项目,就不需要发布啦,如果是模块项目,那么就要发布到nexus里,供其他开发人员下载调用。)
要想发布项目到nexus里,必须通过<distributionManagement>标签来进行配置。在之前的文章中有介绍nexus的工厂类别,其中提到两个:hosted里的Releases、Snapshots.
当我们发布项目到nexus里时,如果项目版本是x.x.x-Releases,则会发布到Releases工厂中;而项目版本是x.x.x-SNAPSHOTS则发布到Snapshots工厂中。
配置<distributionManagement>:
代码:
<distributionManagement><repository><id>releasesId</id><name>Releases name</name><url>http://localhost:8081/nexus/content/repositories/releases/</url></repository><snapshotRepository><id>snapshots id</id><name>snapshots name</name><url>http://localhost:8081/nexus/content/repositories/snapshots/</url></snapshotRepository></distributionManagement>
右键项目 --> run as ---> maven Build... --> 输入clean deploy命令(一开始会下载一些依赖包,淡定.....)。
后面我们会看到如下的提示信息:
怎么来设置授权呢?
【1】:去到nexus管理界面 --- > 左侧菜单栏“Security” --> “Users” ,右侧所列出的用户中,只有deployment用户才有发布项目到nexus的权限。
【2】:在setting.xml里使用<server>标签进行授权。server里的id对应<distributionManagement>里设置的id。
流程是:当执行clean deploy命令进行发布时,首先会找到<distributionManagement>的配置,获取配置信息。
然后如果setting.xml里有配置server,对比id值,如果匹配的上,就验证server里的用户是否拥有发布的权限,有权限就把项目发布到对应的仓库里。
setting.xml中server标签代码:
<server><id>releasesId</id><username>deployment</username><password>deployment123</password></server><server><id>snapshotsid</id><username>deployment</username><password>deployment123</password></server>
至此,发布的配置就完成了,执行clean deploy命令后,就会在nexus的Releases或Snapshots仓库中找到发布的项目了。
链接地址:https://www.cnblogs.com/shihaiming/p/6410813.html
maven jar包 私服 拉去问题,加载jar包时报错ReasonPhrase:unauthorized相关推荐
- readOGR加载shape文件时报错Error in ogrListLayers(dsn = dsn) : Cannot open data source
readOGR加载shape文件时报错Error in ogrListLayers(dsn = dsn) : Cannot open data source 原因是只把shp文件放到工作目录而没有把相 ...
- 9.0 apk加载H5页面时报错WebView is not allowed in privileged processes, apk加载H5 webview加载不出来的问题
apk加载H5页面时报错WebView is not allowed in privileged processes是需要hook下 fun hookWebView() {val sdkInt = B ...
- readOGR加载shape文件时报错
加载shape文件时报错: > library(rgdal) > maps <- readOGR(dsn="/srv/shiny-server/fortune500-mas ...
- 解决HuggingFace加载预训练模型时报错TypeError: expected str, bytes or os.PathLike object, not NoneType
完整报错: TypeError: expected str, bytes or os.PathLike object, not NoneType 解决方法 检查下载的组件: 步骤1:完整的下载组件,包 ...
- 加载预训练模型时报错 KeyError: param ‘initial_lr‘ is not specified in param_groups[0]
在加载预训练模型继续训练时,程序报错:KeyError: "param 'initial_lr' is not specified in param_groups[0] when resum ...
- IDEA加载大文件时报错:The file size exceeds configured limit
1.问题描述: The file size exceeds configured limit 2.解决方案:配置一下idea.properties文件 idea.max.intellisense.fi ...
- FDM向HFM加载 Cell Text时报错
问题描述: 报错信息如下: 2016-01-20 10:03:40,539 INFO [AIF]: ************************************************* ...
- flink sql udf jar包_Java动态加载Jar实例解析
导读:在实际项目开发中,有时会遇到需动态加载jar包的应用场景.如将Flink的UDF自定义方法制作成方法库(既打成一个Jar),在提交给Flink集群的Job中动态加载jar便可使用.下面将举一个简 ...
- IntelliJ IDEA中无法加载jar包导致出现“cannot resolve symbol...”问题的解决
IntelliJ IDEA中无法加载jar包导致出现"cannot resolve symbol..."问题的解决 之前也经常碰到这样的错误,通过reimport.清缓存等方法都可 ...
最新文章
- 服务器云ide_语言服务器协议如何影响IDE的未来
- unix修改ip和计算机名,UNIX shell获取IP和修改IP
- [WebGL入门]十二,模型数据和顶点属性
- Dubbo——增强SPI的实现
- java有理数类的封装_java实验报告有理数的类封装.doc
- layui中日期格式化方式
- Linux运行脚手架vue,Linux Nodejs与vue脚手架详解
- 人脸聚类--最好的防御是进攻
- MSSQL OPTION语句详解
- C#中的委托和Java中的“委托”(Java8 lambda表达式)
- jpadao层继承什么_1岁英短蓝白母猫能卖多少钱,银渐层2岁公猫多少钱
- 将整个网站页面变成黑白色
- easyui框架和显示(一)
- android 微信自带表情,Android 软键盘和emoji表情切换方案,和微信几乎一样的体验...
- Windows10邮件添加qq邮箱已过期问题
- Error while extracting response for type [class xxx] and content type application/xml;charset=UTF-8
- Ubuntu安装搜狗fcitx无法正常安装的问题
- 如何使用Python实现回文的判断?
- 数据分析--数据分析是什么?
- java 数组 distinct_去重是distinct还是group by?