国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php框架 > 框架设计 > nexus离线安装索引及一些问题

nexus离线安装索引及一些问题

来源:程序员人生   发布时间:2016-09-29 09:04:48 阅读次数:3515次

安装私服~~~

整体流程:

  • 服务器安装私服
  • 配置私服(主要是安装索引)
  • 本地maven配置指向私服

安装私服

win & linux 网上教程很多,不在论述;


配置私服(及安装index)

1,在线安装index(下载很慢,且不1定能安装成功)

  将Download Remote Indexes值改成true,点击“save”后,点击左侧的“Administration”->”Scheduled Tasks”链接,如果没有出现“Update Repositories Index”处于Running状态,那末需要在Public Repositories行右击,点击”Update Index”。

这里写图片描述

  然后再点击Schedule Tasks就能够看到有任务处于Running状态了。

这里写图片描述

  等到索引下载完成以后,就能够在”Repositories”界面中,选择Browser Index选项卡,可以看到Maven中央仓库内容的树形结构,以下图所示。

这里写图片描述

2,离线安装index

  首先将索引下载到本地,下载地址:https://pan.baidu.com/s/1hsFLKzU
解压索引紧缩包,将里面内容全部拷贝

  关闭当前Nexus私服,打开Nexus目录%Nexus_Home%\sonatype-work\nexus\indexer\central-ctx,首先删除当前目录里所有内容,然后粘贴所下载的索引,最后启动Nexus私服,索引生效。

注:sonatype-work是nexus安装包解压后的文件夹(与Nexus2.0.6同级目录)。也能够自己修改sonatype-work的位置

修改%Nexus_HOME%/conf/nexus.properties nexus-work=${bundleBasedir}/../../sonatype-work/nexus

本地maven配置指向私服

<mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <name>A Local Nexus Server</name> <url>http://ip:port/nexus/content/groups/public/</url> </mirror>
<id>nexus</id> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://ip:port/repository/maven-public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Nexus</name> <url>http://ip:port/repository/maven-public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories>
<!--加激活profile--> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>

遇到问题:中心仓库的仓库状态报下面err

Remote automatically blocked and unavailable java.security.providerException:java.security.keyException

解决:升级nss

[root@localhost ~]# sudo yum upgrade nss [root@localhost bin]# ./nexus stop [root@localhost bin]# ./nexus start

nss:网络安全服务(NSS)是1个旨在支持跨平台的安全功能的客户端和服务器利用程序的开发库。与NSS内置的利用程序可以支持SSL v2和v3,TLS和的PKCS#5,PKCS#7的,的PKCS#11的PKCS#12的S / MIME,X.509 v3证书和其他安全标准

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生