Centos7下按照配置nexus2

一、什么是Nexus

Centos7下按照配置nexus2

二、安装并配置Nexus

[root@linux-node1 ~]# http://www.sonatype.com/download-oss-sonatype
[root@linux-node1 ~]# tar -xf nexus-2.13.0-01-bundle.tar.gz
[root@linux-node1 ~]# cd nexus-2.13.0-01/bin
[root@linux-node1 ~]# mv nexus-2.13.0-01 /usr/local/
[root@linux-node1 ~]# cd /usr/local/
[root@linux-node1 local]# ls
apache-maven-3.3.9             bin  games    lib    libexec  nexus-2.13.0-01  sbin   src
apache-maven-3.3.9-bin.tar.gz  etc  include  lib64  maven    nodejs           share
[root@linux-node1 local]# ln -s nexus-2.13.0-01 nexus
[root@linux-node1 local]# cd /usr/local/nexus
[root@linux-node1 nexus]# ls
bin  conf  lib  LICENSE.txt  logs  nexus  NOTICE.txt  tmp
[root@linux-node1 nexus]# cp bin/nexus /etc/init.d/
[root@linux-node1 nexus]# chmod 755 /etc/init.d/nexus 
[root@linux-node1 nexus]# chown root /etc/init.d/nexus 、
[root@linux-node1 nexus]# vim /etc/init.d/nexus
NEXUS_HOME="/usr/local/nexus"
RUN_AS_USER=root
[root@linux-node1 init.d]# cd /etc/init.d/
[root@linux-node1 init.d]# chkconfig --add nexus
[root@linux-node1 init.d]# chkconfig --levels 345 nexus on
[root@linux-node1 init.d]# service nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.

三、登录Nexus界面

登录界面:http://{ip}:8081/nexus/
默认用户名密码 admin admin123

四、Nexus的流程

Nexus MAVEN的私有仓库
如果没有nexus 项目的打包都需要通过公网下载
不利于包的管理和共用
如果没有私服,我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地,而一个团队中的所有人都重复的从maven仓库下载构件
Centos7下按照配置nexus2
部署工作流:
Centos7下按照配置nexus2

五、Apache Maven

Apache Maven
To use Nexus Repository Manager Pro and Nexus Repository Manager OSS with Apache Maven, configure Maven to check the repository manager instead of the default, built-in connection to the Central Repository.

To do this, you add a mirror configuration and override the default configuration for the central repository in your ~/.m2/settings.xml as shown:

<settings>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

六、参考资料:

转载于:https://blog.51cto.com/molewan/2132635

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值