使用Nexus创建私服

下载Nexus

下载地址:http://www.sonatype.com/download-oss-sonatype

前置条件

JDK1.8

Windows安装Nexus

在之前的版本中,启动nexus服务都是在cmd中输入 nexus install来安装服务,nexus start来启动服务。

在nexus-3.2.0-01中,直接在nexus根目录下的bin下,输入 nexus.exe/run 即会启动服务。
这里写图片描述

linux安装

  1. 解压安装包

tar –zxvf nexus-3.0.0-03-unix.tar.gz

  1. 修改Jdk路径

Nexus3.0.0的版本需要JDK1.8的版本

  • cd /data/nexus-3.0.0-03/bin

  • vi nexus

  • 添加JDK配置

INSTALL4J_JAVA_HOME_OVERRIDE=/data/jdk1.8.0_91

  1. 修改使用的用户

    • vi nexus.rc

    • 添加配置

    run_as_user=root

  2. 启动nexus服务

    • ./ nexus

配置Nexus

  • 此时的nexus服务都是安装包默认的数据存储路径、端口、IP、访问根目录、内存大小,可以通过如下操作进行修改。
    bin目录下的nexus.vmoptions文件
    这里写图片描述
-Xms1200M
-Xmx1200M
-XX:MaxDirectMemorySize=2G
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-XX:+LogVMOutput 
-XX:LogFile=../sonatype-work/nexus3/log/jvm.log
-Djava.net.preferIPv4Stack=true
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc/karaf
-Djava.util.logging.config.file=etc/karaf/java.util.logging.properties
-Dkaraf.data=../sonatype-work/nexus3
-Djava.io.tmpdir=../sonatype-work/nexus3/tmp
-Dkaraf.startLocalConsole=false
  • 通过根目录下etc目录下的 nexus-default.properties 文件 ,修改默认端口,主机地址和项目名。
    这里写图片描述
## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path=/

# Nexus section
nexus-edition=nexus-pro-edition
nexus-features=\
 nexus-pro-feature

成功验证

访问http://localhost:8081,看是否能跳转到Nexus页面,
Nexus的默认管理员用户名和密码为admin/admin123

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值