maven私服-账号管理
2021/5/15 18:56:05
本文主要是介绍maven私服-账号管理,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
关于maven私服的相关数据:
默认账号admin,密码:admin123
这个账号是不能进行上传代码 到maven仓库的。
我们光是有admin和匿名账号是不够的,我们需要创建一个专门用来部署的账号,ceshi:
(1)涵盖所有匿名账号的权限,至少可以搜索仓库,下载依赖
(2)对仓库有所有的管理权限,就可以往仓库中去部署发布包
创建角色
创建用户
在settings.xml中加入登录账号
<servers> <server> <id>nexus-releases</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>nexus-snapshots</id> <username>deployment</username> <password>deployment123</password> </server> </servers>
在pom中加入添加到的私服 仓库目录
<distributionManagement> <!--正式--> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://localhost:8081/repository/maven-releases/</url> </repository> <!--开发--> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://localhost:8081/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
mvn deploy
本地包如何通过命令上传到maven私服,
-Dpackaging 本地包路径,-Durl需要上传的仓库地址,-DrepositoryId,在settings.xml中登录的账号id
mvn deploy:deploy-file -DgroupId=com.csource -DartifactId=fastdfs-client-java -Dversion=1.24 -Dpackaging=jar -Dfile=C:\Users\HP\.m2\fastdfs_client_v1.24.jar -Durl=http://localhost:8081/repository/3rd-oarty/ -DrepositoryId=nexus-releases
这篇关于maven私服-账号管理的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-15鸿蒙生态设备数量超8亿台
- 2024-05-13TiDB + ES:转转业财系统亿级数据存储优化实践
- 2024-05-09“2024鸿蒙零基础快速实战-仿抖音App开发(ArkTS版)”实战课程已上线
- 2024-05-09聊聊如何通过arthas-tunnel-server来远程管理所有需要arthas监控的应用
- 2024-05-09log4j2这么配就对了
- 2024-05-09nginx修改Content-Type
- 2024-05-09Redis多数据源,看这篇就够了
- 2024-05-09Google Chrome驱动程序 124.0.6367.62(正式版本)去哪下载?
- 2024-05-09有没有大佬知道这种数据应该怎么抓取呀?
- 2024-05-09这种运行结果里的10.100000001,怎么能最快改成10.1?