[idea搭建ssm框架]Maven搭建nexus服务器学习笔记

时间:2020-03-23  来源:php安装  阅读:

如果是公司内部开发,一般都是采用私服来作为中央库。而且官方库国内连接速度非常慢,下载速度只有0点几K每秒,让人很抓狂,使用nexus还可以建立中央库的镜像。

一、安装nexus
nexus官网:http://www.sonatype.com/nexus/product-overview
nexus下载地址:http://www.sonatype.org/nexus/go
这个软件分为多个版本:Nexus OSS、Nexus Pro、Nexus Pro+等。Nexus OSS包含基本仓库管理功能,它是免费的,其余版本要购买授权许可。


1、下载nexus

cd /tmp
wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-latest-bundle.zip
unzip nexus-latest-bundle.zip
mv nexus-2.11.4-01 /home
cd /home/nexus-2.11.4-01/

会解压出nexus-2.11.4-01目录。

2、执行脚本
在nexus-2.11.4-01目录下有这几个目录:
LICENSE.txt NOTICE.txt bin conf lib logs nexus tmp
在bin目录下有一个名为nexus的脚本。

 

使用方法:

Usage: ./nexus { console | start | stop | restart | status | dump }

执行:

./nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.

3、访问管理页面
浏览器输入:http://IP:8081/nexus/
这种启动方式是使用内嵌jetty的bundle运行,服务器需要安装JDK。jetty是一个运行jsp、servlet的容器,和tomcat类似。

 

用户名:admin
密码:admin123

 

端口号可以在conf目录下nexus.properties内修改。

 

二、配置仓库
1、开启远程索引
我们要同步官方的中央库,首先要开启远程索引,下载索引文件。
1)点击Repositories

 

2)分别选择type为proxy的三个库Apache Snapshots、Central、Codehaus Snapshots

 

3)将Download Remote Indexes设置为true

 

4)在Apache Snapshots,Codehaus Snapshots和Central这三个仓库上分别右键,选择Repari Index

 

PS:只有Central库下载索引文件成功,另两个中央库是Not published状态。。。

 

2、health check
点击绿色的analyze

 

点击YES。

 

三、项目配置
在项目的pom.xml中增加:
        my-maven     My Maven     http://IP:8081/nexus/content/repositories/central/            true                 true          


这样当本地获取依赖包时会通过私服中央库镜像里下载依赖包。

[idea搭建ssm框架]Maven搭建nexus服务器学习笔记

http://m.bbyears.com/jiaocheng/89003.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新