Centos7下按照配置nexus2

1、什麼是Nexus

Centos7下按照配置nexus2

2、安裝並配置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.

3、登陸Nexus界面

登陸界面:http://{ip}:8081/nexus/
默認用戶名密碼 admin admin123node

4、Nexus的流程

Nexus MAVEN的私有倉庫
若是沒有nexus 項目的打包都須要經過公網下載
不利於包的管理和共用
若是沒有私服,咱們所需的全部構件都須要經過maven的中央倉庫和第三方的Maven倉庫下載到本地,而一個團隊中的全部人都重複的從maven倉庫下載構件
Centos7下按照配置nexus2
部署工做流:
Centos7下按照配置nexus2linux

5、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.apache

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

<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>

6、參考資料:

相關文章
相關標籤/搜索