Centos7下按照配置nexus2

一、什么是Nexus

二、安装并配置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仓库下载构件

部署工作流:

五、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:


  
    
      
      nexus
      *
      http://localhost:8081/nexus/content/groups/public
    
  
  
    
      nexus
      
      
      
        
          central
          http://central
          true
          true
        
      
     
        
          central
          http://central
          true
          true
        
      
    
  
  
    
    nexus
  

六、参考资料:

  • maven结合Nexus:
    https://help.sonatype.com/repomanager2/maven-and-other-build-tools/jenkins
  • Jenkins中选择Nexus插件:
    https://help.sonatype.com/repomanager2/maven-and-other-build-tools/jenkins

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

你可能感兴趣的:(Centos7下按照配置nexus2)