Maven配置私有仓库(maven配置私库地址) | 您所在的位置:网站首页 › maven配置nexus私库 › Maven配置私有仓库(maven配置私库地址) |
本篇文章为你整理了Maven配置私有仓库(maven配置私库地址)的详细内容,包含有maven使用私有仓库 maven配置私库地址 maven仓库配置文件 如何搭建maven私有库 Maven配置私有仓库,希望能帮助你了解 Maven配置私有仓库。 当公司或个人具有自己独有的jar时,不想公开,一般就会放在自己的私有Maven仓库中,在项目中需要引用,此时就需要将公司私有仓库配置到maven当中,一般我们的maven配置的都是aliyun的maven公有仓库,但此时我们不但要配置私有仓库还要配置公有仓库,因为有的公有jar,私有仓库中不一定有,所以此时就涉及到maven多仓库配置喽。 maven配置一共分为两种 统一配置,通过maven的setting.xml文件配置,每个项目都可直接使用。 项目配置,在项目的pom.xml文件中配置(有得项目需要进行定制化配置,但其他项目又不需要这个仓库) 以下使用的统一配置方式来进行配置哈。项目配置可自行百度。希望可以帮助到大家。 1、Setting.xml 在本地maven的setting.xml配置文件中进行私有仓库配置。 在 servers /servers 标签中配置仓库访问账号和密码。 在 mirrors /mirrors 标签中配置仓库地址。 在 profiles /profiles 标签中配置多仓库使用。 在 activeProfiles /activeProfiles 中激活仓库,否则配置无效。 mirrors
mirror id nexus-repository /id mirrorOf central /mirrorOf name Nexus repository /name url http://192.168.0.1::8081/content/groups/public/ /url /mirror mirror id alimaven /id name aliyun maven /name url http://maven.aliyun.com/nexus/content/groups/public/ /url \ mirrorOf central /mirrorOf /mirror /mirrors profiles profile id repository /id repositories repository id central /id url http://central /url releases enabled true /enabled /releases snapshots enabled true /enabled /snapshots /repository /repositories pluginRepositories pluginRepository id central /id url http://central /url releases enabled true /enabled /releases snapshots enabled true /enabled /snapshots /pluginRepository /pluginRepositories /profile profile id alimaven /id repositories repository id central /id url http://central /url releases enabled true /enabled /releases snapshots enabled true /enabled /snapshots /repository repository id Dcm4Che /id name Dcm4Che /name url http://www.dcm4che.org/maven2/ /url releases enabled true /enabled /releases snapshots enabled false /enabled /snapshots /repository /repositories pluginRepositories pluginRepository id nexus /id url http://maven.aliyun.com/nexus/content/groups/public/ /url releases enabled true /enabled /releases snapshots enabled true /enabled /snapshots /pluginRepository /pluginRepositories /profile /profiles activeProfiles activeProfile repository /activeProfile activeProfile alimaven /activeProfile /activeProfiles
2、刷新IDEA项目 查看maven仓库引用
此刻配置就成功了,即可使用远程私有仓库拉去jar,如果找不到相关jar,会自动去aliyun中央仓库下载公有maven坐标。
以上就是Maven配置私有仓库(maven配置私库地址)的详细内容,想要了解更多 Maven配置私有仓库的内容,请持续关注盛行IT软件开发工作室。 郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系QQ332078507,我们将第一时间修改或删除,多谢。 |
CopyRight 2018-2019 实验室设备网 版权所有 |