Maven私服架设(nexus / on windows)

点击右上角login,默认账户:admin/admin123
<mirror>
<id>nexus</id>
<url>http://localhost/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
上述配置表示使用本地的public仓库组作为所有外部仓库的镜像,换句话说,maven在查找依赖的时候首先从本地找,找不到才去外部仓库找,需要注意的是,即使我们这里配置了本地仓库作为外部所有仓库的依赖,但是此时maven仍然还会去连接central(中央仓库),如果想要彻底阻止maven访问远程central仓库,我们还需要做如下配置:
<profile>
<id>nexus</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>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
这样maven就可以访问本地仓库来替代访问外部仓库了
<distributionManagement>
<repository>
<id> nexus-releases</id >
<name> Local nexus releases repository</name >
<url> http://localhost/nexus/content/repositories/releases/ </url>
</repository>
<snapshotRepository>
<id> nexus-snapshots</id >
<name> Local nexus snapshots repository</name >
<url> http://localhost/nexus/content/repositories/snapshots/ </url>
</snapshotRepository>
</distributionManagement>
说明:上面的配置文件中指定的是将打包文件部署到本地的一个仓库,对外部或本地仓库的访问一般都需要配置权限,所以还需要在settings.xml文件中配置访问权限
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
上面的<server>.<id>节点中的名称需要和<repository>的<id>中定义的名称保持一致
Maven私服架设(nexus / on windows)的更多相关文章
- Maven 私服(Nexus)
@[toc](Maven 私服(Nexus)) 1.Nexus 简介 Nexus是Maven仓库管理器,也可以叫Maven的私服.Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库 ...
- window Maven私服搭建——nexus
注:本文来源于 <window Maven私服搭建--nexus> Maven私服搭建--nexus 1.下载nexus https://www.sonatype.com/downlo ...
- maven私服搭建nexus/windows/linux(一)
为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,还有就是公司内部开发的一些版本的jar包,如果没有私服需要一人拷贝一份然后再自己安 ...
- maven私服搭建nexus介绍(二)
1.各个仓库介绍 Hosted:宿主仓库 主要放本公司开发的SNAPSHOTS测试版本,RELEASES正式发行版.合作公司第三方的jar包. Proxy:代理仓库 代理中央仓库:代理Apache下测 ...
- Maven私服搭建及使用-Windows版
了解有限,目前只针对基础功能介绍,持续更新 一.下载对应的版本(本例版本:nexus-3.7.1-02) https://www.sonatype.com/download-oss-sonatype ...
- Maven私服搭建(Nexus Repository Manager 3)
下载和安装 下载地址:https://help.sonatype.com/repomanager3/download 注意:Nexus Repository Manager 3是一个Java服务器应用 ...
- Maven私服Nexus的搭建
# Maven私服Nexus的搭建 ## 私服存在的合理性 Maven中的依赖是从服务器仓库中下载的,Maven的仓库只有两大类: - 1) 本地仓库 - 2) 远程仓库,其中在远程仓库中又分成了3种 ...
- maven私服nexus搭建(windows)
1.下载nexus 地址:https://www.sonatype.com/download-oss-sonatype 下载相应版本的zip包. 2.安装nexus 下载完成后,解压到本地任意目录. ...
- Windows使用Nexus搭建Maven私服
简介 Maven私服是架设在局域网的一种特殊的远程仓库,目的是代理远程仓库及部署第三方构件,有了私服之后,当 Maven 需要下载构件时,直接请求私服,私服上存在则下载到本地仓库,否则,私服请求外部的 ...
随机推荐
- 美团点评2017校招笔试真题-算法工程师A
美团点评2017校招笔试真题-算法工程师A 1.下面哪种STL容器的实现和其它三个不一样 A. set B. deque C. multimap D. map 正确答案: B STL的容器可以分为以下 ...
- Mysql & Hive 导入导出数据
---王燕行转列sql select split(concat_ws(',',collect_set(cast(smzq as string))),',')[1] ,split(concat_ws(' ...
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defi ...
- (最小生成树) Arctic Network -- POJ --2349
链接: http://poj.org/problem?id=2349 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1371 ...
- c++内存管理方式
概述 本章总结一些关于个人对内存管理的理解,主要包括如下内容: 内存管理原则 优秀的接口 智能指针的作用在哪里? 内存管理原则 学c++的同学都知道这个内存管理原则,就是“谁创建,谁释放”或者说“谁申 ...
- MFC 的SetWindowPos 用法
转自于:http://hi.baidu.com/max_new/blog/item/e2bbe607b1f127c57b8947c0.html 许多软件,特别是占桌面面积不是很大的软件,通常都提供了一 ...
- Linux C 创建目录函数mkdir相关【转】
转自:http://blog.csdn.net/fallenink/article/details/8480483 原文地址:http://sharp2wing.iteye.com/blog/1280 ...
- float 为什么不能用== ,或者大于等于,或者小于等于
本文尝试着将以下内容做一个浅显的解释,主要包括浮点数为什么是不精确的,浮点数为什么不能用==和!=直接比较,以及浮点数的比较方法等几个方面.如果那个地方说的不对还请各位看官不吝赐教!欢迎大家评论区讨论 ...
- 【最大流之ek算法】HDU1532 求最大流
本来是继续加强最短路的训练,但是遇到了一个最短路 + 最大流的问题,最大流什么鬼,昨天+今天学习了一下,应该对ek算法有所了解,凭借学习后的印象,自己完成并ac了这个最大流的模板题 题目大意:都是图论 ...
- js 面向对象 继承机制
根据w3cschool上的描述:共有3种继承方法(对象冒充,原型链,混合) 1.对象冒充:构造函数ClassA使用this关键字给所有属性和方法赋值,使ClassA构造函数成为ClassB的方法,调用 ...