maven搭建私服
2016-07-15 00:00
211 查看
摘要: 虽然接触maven有几年了 但是用的过程中 都是直接用 还没有自己亲自搭建私服
1 下载Nexus 地址: http://www.sonatype.org/nexus/go
2 启动Nexus,就是启动一个web服务器,
我下载的是zip包,解压后进入\nexus-2.1.2-bundle\nexus-2.1.2\bin\jsw\,根据操作系统类型选择文件夹,我选的是windows-x86-64文件夹,进入后可看到如下所示bat文件。
默认地址http://localhost:8081/nexus/,默认用户名密码为admin/admin123.。Nexus在一个名为Jetty的servlet容器中运行
修改默认端口号:8081为默认的端口号,要修改端口号可进入nexus-2.1.2-bundle\nexus-2.1.2\conf\打开nexus.properties文件,修改application-port属性值就可以了。
Nexus 的仓库分为这么几类:
hosted 宿主仓库:主要用于部署无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动)以及自己或第三方的项目构件;
proxy 代理仓库:代理公共的远程仓库;
virtual 虚拟仓库:用于适配 Maven 1;
group 仓库组:Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。
nexus默认是关闭远程索引下载功能的。开启的方式:
点击Administration菜单下面的Repositories,将这三个仓库Apache Snapshots,Codehaus Snapshots,Maven Central的
Download Remote Indexes修改为true。然后在这三个仓库上分别右键,选择Re-index,这样Nexus就会去下载远程的索引文件。
两个比较快的远程仓库:
部署构建到maven私服
1 在pom文件中添加如下配置:
2 在setting.xml文件中添加认证信息:
安装中出现:找不到 nexus-maven-repository-index.zip
解决方案:
参考:http://blog.csdn.net/liujiahan629629/article/details/39272321
http://www.cnblogs.com/kevingrace/p/6201984.html http://www.cnblogs.com/quanyongan/archive/2013/04/24/3037589.html
拓展 nexus 3.X的安装 参考:http://blog.csdn.net/fengyunhaitan/article/details/51685498
1 下载Nexus 地址: http://www.sonatype.org/nexus/go
2 启动Nexus,就是启动一个web服务器,
我下载的是zip包,解压后进入\nexus-2.1.2-bundle\nexus-2.1.2\bin\jsw\,根据操作系统类型选择文件夹,我选的是windows-x86-64文件夹,进入后可看到如下所示bat文件。
默认地址http://localhost:8081/nexus/,默认用户名密码为admin/admin123.。Nexus在一个名为Jetty的servlet容器中运行
修改默认端口号:8081为默认的端口号,要修改端口号可进入nexus-2.1.2-bundle\nexus-2.1.2\conf\打开nexus.properties文件,修改application-port属性值就可以了。
Nexus 的仓库分为这么几类:
hosted 宿主仓库:主要用于部署无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动)以及自己或第三方的项目构件;
proxy 代理仓库:代理公共的远程仓库;
virtual 虚拟仓库:用于适配 Maven 1;
group 仓库组:Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。
nexus默认是关闭远程索引下载功能的。开启的方式:
点击Administration菜单下面的Repositories,将这三个仓库Apache Snapshots,Codehaus Snapshots,Maven Central的
Download Remote Indexes修改为true。然后在这三个仓库上分别右键,选择Re-index,这样Nexus就会去下载远程的索引文件。
两个比较快的远程仓库:
<mirror> <id>ui</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://uk.maven.org/maven2/</url> </mirror> <mirror> <id>mirrors.ibiblio.org</id> <name>mirrors.ibiblio.org</name> <url>http://mirrors.ibiblio.org/maven2/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>jFog</id> <name>bintray</name> <url>http://jcenter.bintray.com/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
部署构建到maven私服
1 在pom文件中添加如下配置:
<distributionManagement> <repository> <id>releases</id> <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshot</id> <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
2 在setting.xml文件中添加认证信息:
<server> <id>Snapshots</id> <username>admin</username> <password>admin123</password> </server> <server> <id>Releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>third-party</id> <username>admin</username> <password>admin123</password> </server>
安装中出现:找不到 nexus-maven-repository-index.zip
解决方案:
手动下载 首先将索引下载到本地,下载地址: http://pan.baidu.com/share/link?shareid=2749210917&uk=2770786686&fid=62414455177873 解压索引压缩包,将里面内容全部拷贝 关闭当前Nexus私服,打开Nexus目录%Nexus_Home%\sonatype-work\nexus\indexer\central-ctx, 首先删除当前目录里所有内容,然后粘贴所下载的索引,最后启动Nexus私服,索引生效。
参考:http://blog.csdn.net/liujiahan629629/article/details/39272321
http://www.cnblogs.com/kevingrace/p/6201984.html http://www.cnblogs.com/quanyongan/archive/2013/04/24/3037589.html
拓展 nexus 3.X的安装 参考:http://blog.csdn.net/fengyunhaitan/article/details/51685498
相关文章推荐
- Java中的String类
- JAVA 内存管理总结
- mysql命令(二)--数据类型
- MathType公式编号的格式可以这样修改
- 这些输出格式是ChemDraw 15支持的吗
- 几何画板如何创建滑行反射变换
- 送给以后的自己…
- DeepFace: Closing the Gap to Human-Level Perform中文
- OpenBr官方教程-快速入门
- asp.net mvc code first实体关系一对一、一对多、多对多的设置方法
- 实现统计在线用户的几种方式,欢迎大家发表观点!
- thinkphp【错误改动大全】
- lnmp一键安装包
- java web中Excel文件导入
- Oracle存储过程(二)
- 简单配置搞定 Nginx + Tomcat + HTTPS
- iOS开发总结-Xcode常见错误
- Spring基于注解实现Bean定义支持如下三种注解
- 老司机教你怎样下载电影
- JNI常见异常及处理方法