vaven进阶 2022年5月8日 06:54 • Java 私服(nexus) 私服的搭建一般由运维人员来做的 安装nexus 和 启动 解压nexus-2.12.0-01-bundle.zip后得到两个文件夹 私服仓库 私服软件: BS结构的,通过浏览器访问 安装: 进入到私服的bin目录下: nexus.bat install 安装成功后本地服务里会多了个nexus服务,默认没有启动 我们通过命令行启动: nexus.bat start 启动失败的解决方法: nexus/nexus-2.12.0-01/bin/jsw/conf/wrapper.conf 把第15行: wrapper.java.command=xxx(jdk安装路径)/bin/java.exe 访问私服: http://localhost:8081/nexus 登录nexu 用户名/密码(默认): admin/admin123 仓库类型 Virtual—>虚拟仓库(不起任何作用,以后也用不到) Proxy—>代理仓库 Hosted—>宿主仓库—本地仓库 Group—>组 需求 把dao放到私服上,然后service从私服上下载 第一步:需要在客户端(部署dao工程的电脑)上配置maven环境,并修改settings.xml文件,配置连接私服的用户和密码 此用户名和密码用于私服校验,因为私服需要知道上传都的账号和密码是否和私服中的账号和密码一致 第二步:配置项目pom.xml,配置私服地址 配置私服仓库的地址,本公司的自己的jar包会上传到私服的宿主仓库,根据工程的版本号决定上传到哪个宿主仓库,如果版本为release则上传到私服的release仓库,如果版本为snapshot则上传到私服的snapshot仓 注意:pom.xml这里<id> 和 settings.xml 配置 <id> 对应 在maven中配置用户信息(settings.xml) 右键–>run as—>maven built…—>deploy 修改后pom.xml版本号要改 [XML] 纯文本查看 复制代码 ? 01 02 03 04 05 06 07 08 09 10 <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> [XML] 纯文本查看 复制代码 ? 01 02 03 04 05 06 07 08 09 10 <distributionManagement> <repository> <id>releases</id> <url>http://localhost:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> 将ssh_dao的这个工程打成jar包,并放入到私服上去 第一步 修改settings.xml 删除本地仓库中的dao update service工程,出现以下信息说明已经成功 [XML] 纯文本查看 复制代码 ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 <profile> <!--profile的id--> <id>dev</id> <repositories> <repository> <!--仓库id,repositories可以配置多个仓库,保证id不重复--> <id>nexus</id> <!--仓库地址,即nexus仓库组的地址--> <url>http://localhost:8081/nexus/content/groups/public/</url> <!--是否下载releases构件--> <releases> <enabled>true</enabled> </releases> <!--是否下载snapshots构件--> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!-- 插件仓库,maven的运行依赖插件,也需要从私服下载插件 --> <pluginRepository> <!-- 插件仓库的id不允许重复,如果重复后边配置会覆盖前边 --> <id>public</id> <name>Public Repositories</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </profile> <activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles> 原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/java/253315.html # 浏览器AppjavaMavenmicrosoftNexus 赞 (0) 0 0 生成海报 jdk1.5的新特性(下) 上一篇 2022年5月8日 06:52 Elasticsearch与Solr比较 下一篇 2022年5月8日 06:57 相关推荐 自动展开那些需要点击才能阅读全文的网站,已支持47个网站 2021年9月21日 从实际代码开始编写好的示例 2021年8月6日 如何在 Ubuntu 和其他 Linux 发行版中创建照片幻灯片 2022年5月14日 JSP页面的注释细节详解编程语言 2021年7月19日 Debian GNU/Linux 9.3 Stretch 和8.10 Jessie正式发布 2021年7月25日 CSS常见兼容性问题总结详解编程语言 2021年7月19日 MariaDB完成C轮2700万美金融资,阿里巴巴领投 2021年8月6日 牛客 HJ10 字符个数统计(Java 哈希表) 2022年7月31日 java poi导出带有多个sheet页的excel详解编程语言 2021年7月19日 ABAP面试问题及侧重点详解编程语言 2021年7月19日 发表回复 请登录后评论...登录后才能评论 提交