近期在搭建nuget私服。选择nexus这个产品。nexus支持npm,.nuget等,功能比较强大。

前言

博主使用centos7.5来搭建nexus,遇到了不少的问题。最后还是搞定了。

1:下载nexus

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

2:上传nexus压缩包到centos上

输入一下命令,进入到home目录

 cd /home

然后创建一个文件夹 ,输入一下命令

mkdir  nexus

然后用ftp工具把,下载下来的压缩包,上传到这个 目录  /home/nexus

3:解压压缩包

输入下面的命令

tar -zxvf nexus-3.15.--unix.tar.gz

然后重命名刚才解压后的文件夹,给个好记的文件夹名字。

3:开启端口

由于nexus的默认端口是8081,这个端口,被我另一个程序所占了,所以换个端口,换成8082

输入下面的命令开启端口。

firewall-cmd --zone=public --add-port=/tcp --permanent

然后重启防火墙,输入下面的命令

systemctl restart firewalld

4:创建Nexus的运行用户

输入下面的命令

adduser nexus

创建密码

passwd nexus

给nexus用户添加root权限

chmod u+w /etc/sudoers
vi/etc/sudoers

在root下添加nexus用户权限

添加

nexus ALL=(ALL) ALL

保存后撤回写的权限

chmod u-w /etc/sudoers

修改nexus目录的所有者

hown -R nexus /home/nexus

5:运行nexus

运行之前检查是否装了jdk

输入 java -version  看看是否装了jdk,没装的就去装,怎么装就不说了。

更改nexus的启动端口

进入到刚才我们解压neuxs文件夹的etc目录下,我的目录是

cd /home/nexus/nexus-/etc

编辑下面这个文件

vi nexus-default.properties
## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=
application-host=192.168.44.128
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

记得把host 也改了,我改成127.0.0.1,还是无法方法,改成Ip地址才可以。

然后进入到bin目录

输入下面的命令启动

 ./nexus start   启动
./ nexus restart 重启
./nexus stop 停止
./nexus run 跑

等显示nexus  is runing 然后 我们停止他。

nexus不建议用root用户启动。我们用nexus用户来运行他。

进入到nexus的bin目录

编辑下面这个文件

vi nexus.rc

run_as_user="nexus "

记得把前面的注释符号给去除了。

给nexus的启动文件添加java_home

在nexus的bin目录下打开nexus的启动文件

输入下面的命令

vi  nexus

然后在开头找到下面这句代码,取消注释,添加上jdk地址

INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-1.8.-openjdk-1.8.0.191.b12-.el7_6.x86_64

6:添加systemctl 的启动操作

创建nexus.service服务

vi /usr/lib/systemd/system/nexus.service
[Unit] 

    Description = nexus service 

    After = network.target 

    [Service] 

    Type = forking 

    LimitNOFILE =  

    ExecStart = /home/nexus/nexus-/bin/nexus start 

    ExecReload= //home/nexus/nexus-3/bin/nexus restart

    ExecStop =  /home/nexus/nexus-/bin/nexus stop
User=nexus
Restart = on- abort [Install] WantedBy = multi-user.target

分别执行下面的命令

systemctl daemon-reload
systemctl enable nexus.service
systemctl start nexus.service

然后在浏览器输入http://ip:8020

然后点击登陆输入账号admin 密码admin123

使用nexus来搭建Nuget私服的更多相关文章

  1. Nexus 3 搭建 npm 私服 (windows)

    Nexus 3 搭建 npm 私服备忘 下载与安装 在官网下载Nexus Repository Manager OSS 3.x, 解压至任意位置. 管理员运行 powershell, 切换到 nexu ...

  2. 一步一步搭建Nuget私服

    大致流程:1. 通过VS创建一个Web空项目,然后通过Nuget引入Nuget.Server(目前最新版3.2.1).2. 直接将这个Web项目发布到IIS.3. 通过nuget.exe打包*.nup ...

  3. 【snaptype nexus】搭建maven私服仓库

    搭建本地开发私库,旨在解决本地开始受限于网络环境的问题:具体的搭建步骤主要包含以下几个步骤: 1.私服服务器使用的是ubuntu,首先下载安装包(版本号:2.12),下载地址:http://www.s ...

  4. 搭建Nuget服务器(Nuget私服)

    一.前言 对公司或者对个人来说,经过一段时间的沉淀之后,都会有一些框架或者模块,为了对这些框架或者模块进行更好的管理和维护,也为了方便后面的开发或者其他同事,我们可以在我们本地或者内网搭建一个Nuge ...

  5. Maven学习 (四) 使用Nexus搭建Maven私服

    为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,所以很有必要在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到 ...

  6. Maven-004-使用 Nexus 搭建 maven 私服

    从去年至今,自己一直在学习自动化测试工具,想利用自动化工具尽可能的将重复的.关键的.耗时耗力的工作实现自动化,减轻日常测试工作,提升测试效率.在学习的过程中,将 maven 作为了项目开发管理工具,进 ...

  7. Ubuntu server下搭建Maven私服Nexus

    Ubuntu server下搭建Maven私服Nexus Maven私服Nexus的作用,主要是为了节省资源,在内部作为maven开发资源共享服务器来使用. 1.下载 通过root用户进去Ubuntu ...

  8. Maven使用笔记(五)Sonatype Nexus 搭建Maven 私服

    1. 为什么使用Nexus 如果没有私服,我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地, 而一个团队中的所有人都重复的从maven仓库下载构件无疑加大了仓库的负载 ...

  9. 【原创】Nexus搭建Maven私服

    前言: 公司一般都有个自己的私服来管理各种jar包,原因大概有这么3个,分别是: 1.有的公司不能访问外网,只能通过私服来管理jar包和插件: 2.公司网速比较慢,通过公司的私服来获取jar包比较快: ...

随机推荐

  1. 8.String to Integer (atoi) (INT; Overflow)

    Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...

  2. ios 进入后台 一段时间在进入前台 动画消失

    http://www.cnblogs.com/YouXianMing/p/3670846.html

  3. [leetcode]632. Smallest Range最小范围

    You have k lists of sorted integers in ascending order. Find the smallest range that includes at lea ...

  4. 20-最大k乘积问题

    /*                                             最大k乘积问题        题目内容: 设I是一个n位十进制整数.如果将I划分为k段,则可得到k个整数. ...

  5. php 输出缓冲 Output Control

    关于php的输出缓冲,首先要说明的是什么是缓冲(buffer),比如我们通过记事本在编辑文件的时候,并不是我们输入了内容,系统就会立刻向磁盘中写入数据.只有我们在保存文件后,系统才会向磁盘写入数据.而 ...

  6. 移动端input验证只允许有数字 在safari浏览器一直不成功解决

    <input class="lineHeight-30" type="text" onkeyup="value=value.replace(/[ ...

  7. Codeforces 689C. Mike and Chocolate Thieves 二分

    C. Mike and Chocolate Thieves time limit per test:2 seconds memory limit per test:256 megabytes inpu ...

  8. composer install 时,提示:Package yiisoft/yii2-codeception is abandoned, you should avoid using it. Use codeception/codeception instead.的解决

    由 SHUIJINGWAN · 2017/11/24 1.composer install 时,提示:Package yiisoft/yii2-codeception is abandoned, yo ...

  9. [Selenium]对弹出的Alert窗口进行操作

    Alert alert = driver.switchTo().alert(); alert.accept();

  10. tomcat 启动报 找不到 StrutsPrepareAndExecuteFilter。。

    <?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://w ...