Run Docker Image
1 | docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms4g -Xmx4g -XX:MaxDirectMemorySize=3g -Djava.util.prefs.userRoot=/nexus-data/user/root" -v $PWD/volume:/nexus-data sonatype/nexus3:3.19.1 |
Deploy on Kubernetes
Deployment
1 | apiVersion: apps/v1beta1 |
Permission Error
1 | mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied |
Solution:修改 /nexus-data 目录的权限为777或者757
Role
- add only read role, permission follow:
1 | nx-repository-view-*-*-* |
- add deploy role, permission follow:
1 | nx-repository-view-*-*-add |
Usage
Maven Configuration
1 | <settings> |
Project Pom
1 | <distributionManagement> |
Minimal deploy maven jar permission
1 | nx-repository-view-*-*-add |
Sync maven lib
1 | <repositories> |
Deploy to Private Repository
1 | mvn deploy |
Multiple Repository
Reference
- [本地私服仓库nexus3.3.1使用手册] https://cloud.tencent.com/developer/article/1098081
- [Nexus3最佳实践系列:搭建Docker私有仓库] https://zhang.ge/5139.html
- [Nexus3私有仓库搭建 docker+maven+npm] https://segmentfault.com/a/1190000016223871
- [maven发布项目到私服-snapshot快照库和release发布库的区别和作用及maven常用命令] https://www.cnblogs.com/rwxwsblog/p/6029636.html