vaven进阶 2022年5月8日 06:54 • 编程笔记 私服(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/pnotes/253315.html # 浏览器AppMavenmicrosoftNexus 赞 (0) 0 0 生成海报 jdk1.5的新特性(下) 上一篇 2022年5月8日 06:52 Elasticsearch与Solr比较 下一篇 2022年5月8日 06:57 相关推荐 微软Chromium内核Edge浏览器扩展插件网站上线 2021年9月13日 CSS Animation性能优化 2022年5月21日 【技术快报】5.1-5.8 2021年8月21日 RabbitMQ:伪延时队列 2022年5月8日 干货|树莓派4B 搭建 OpenVINO 环境 2021年8月11日 新的 Windows11 微软商店现在正向 Windows 10 PC 推出 2021年11月12日 weixin-java-tools 教程 2022年5月3日 Ubuntu 下dotnet 6的奇葩问题 2022年8月26日 资料 | A Byte of Python 2021年9月2日 微软宣布面向企业提供的自动化工作流工具PAD现在向消费用户免费提供 2021年7月24日 发表回复 请登录后评论...登录后才能评论 提交