Nexus 私服的搭建

1、下载nexushtml

  nexus下载地址:https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.1-01-bundle.tar.gz 我这里下载的是nexus-2.11.1-01-bundle.tar.gz,若链接没法下载,可将其复制进迅雷中便可。java

注意:若本身下载的是 nexus-3.0.0-03-unix.tar.gz  或是更高的版本,则必须将jdk升级到8,不然会出现一下错误:vim

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8 and at most 1.8.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.浏览器

2、启动nexus服务服务器

  将nexus包拷贝到/opt/nexus目录,使用tar命令解压。 解压以后会有两个文件夹nexus-2.11.1-01和sonatype-work,进入第一个文件夹的bin目录来启动nexus 。oracle

   进入启动命令启动:app

      cp nexus-2.11.1-01/bin/maven

     ./nexus startui

  这时候提示:this

****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.

大概意思就是要在环境配置export RUN_AS_USER=root,临时配置

在命令行下输入:export RUN_AS_USER=root

而后执行./nexus start,就不会再提示了

    tips: 也能够在系统里面永久配置 :

                     vim /etc/profile  在最后添加  export RUN_AS_USER=root

                    而后重启环境变量配置  source /etc/profile

启动nexus后,打印以下信息:

[root@localhost bin]# ./nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.

这里提个醒,必定要注意java的版本,以及8081端口是否被占用等 ,也能够在conf/目录下的nexus.propertise文件中修改nexus的默认端口,application-port=8060  我这里指定的是8060。

一切顺利的话,咱们在浏览器输入http://192.168.199.130:8060/nexus/(这里192.168.199.130是nexus安装的服务器ip),便可访问nexus客户端,默认的用户名和密码:admin admin123

点击右上角的 Log In 

3、上传jar包到nexus

首先是下载jar包,oracle的驱动包,因为Oracle受权问题,maven中央仓库没提供,咱们本身下载,

http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

而后按以下图进行操做:

在Artifact Upload页面,进行以下操做,具体就不细说了,见图:

弄完以后,咱们能够在以下页面看到本身上传的jar包;

4、pom.xml的配置

拷贝上图右下角的XML信息到pom.xml,即 :

在pom中配置下仓库信息,以下 :

能够在启动或是导入新包验证是否配置成功,也能够查询maven日志。

相关文章
相关标签/搜索