1. 程式人生 > >Nexus私服搭建及settings.xml配置詳細教程

Nexus私服搭建及settings.xml配置詳細教程

配置:

centos 7

安裝流程如下:

# useradd nexus

# passwd nexus

$ su nexus

$ cd

$ wget nexus-3.12.1-01-unix.tar.gz && mkdir nexus3

$ tar zxvf nexus-3.12.1-01-unix.tar.gz -C nexus3

然後配置(可選):

$ vim nexus3/nexus-3.12.1-01/bin/nexus.vmoptions

執行命令:

$ bin/nexus run    //前臺啟動命令

$ bin/nexus start    //後臺啟動命令

$ bin/nexus stop    //停止命令

$ bin/nexus start    //重啟命令

開放防火牆埠:

# firewall-cmd --permanent --add-port=8081/tcp

# firewall-cmd --reload

訪問網址:http://ip:8081,如下:

點選Sign in登入輸入預設賬號密碼:admin/admin123

maven倉庫:

倉庫

型別

描述

maven-central

proxy

遠端中央倉庫

maven-releases

hosted

私庫發行倉庫

maven-snapshots

hosted

私庫快照倉庫

maven-public

group

倉庫組

nexus3自帶的nuget-* 倉庫可以刪除,nuget是微軟.NET開發平臺的軟體包管理器,這裡用不到。

倉庫型別:

型別

描述

proxy

可以自主配置使用的遠端倉庫地址

hosted

內部專案構件釋出的倉庫型別

virtual

虛擬倉庫型別(基本不用)

group

可以自由順序組合多個倉庫使用

建立倉庫

建立Proxy倉庫:

Repository-->Repositories-->Create repository-->maven2(proxy)

建立第三方構建倉庫:

Repository-->Repositories-->Create repository-->maven2(hosted)

注:第三方構建包可手動上傳到此倉庫。

配置倉庫組(預設已有一個maven-public):

Repository-->Repositories-->Create repository-->maven2(group)

注:注意倉庫順序。maven查詢依賴時會依次遍歷倉庫組中的倉庫。

建立角色

Security-->Roles-->Create

注:建立角色的同時可以為當前建立的角色分配許可權。

建立使用者

Security-->Users-->Create

注:建立使用者併為建立的使用者掛上相應的角色。

上傳構件到第三方庫

Browse-->3rd.party-->Upload component

選擇jar包並填寫相應資訊然後直接上傳即可。

配置Maven settings.xml檔案:

<?xml version="1.0" encoding="UTF-8"?>



<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd">

  

  <localRepository>C:\software\programme\Java\apache-maven-3.5.3-repository</localRepository>





  <pluginGroups>



  </pluginGroups>





  <proxies>

  </proxies>





  <servers>

        <server>

            <id>nexus-releases</id>

            <username>deployment</username>

            <password>[email protected]</password>

        </server>

        <server>

            <id>nexus-snapshots</id>

            <username>deployment</username>

            <password>[email protected]</password>

        </server>

  </servers>





  <mirrors>

      <mirror>

          <!-- <id>edu-nexus3</id> -->

          <id>edu-nexus3</id>

          <url>http://xxx.xxx.124.xxx:8081/repository/maven-public/</url>

          <mirrorOf>central</mirrorOf>

      </mirror>

  </mirrors>





  <profiles>

        <profile>

            <id>development</id>

            <activation>

                <jdk>1.8</jdk>

            </activation>

            <properties>

                <maven.compiler.source>1.8</maven.compiler.source>

                <maven.compiler.target>1.8</maven.compiler.target>

                <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>

            </properties>

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

        <activeProfile>development</activeProfile>

  </activeProfiles>

  

</settings>

然後在需要部署的檔案上使用 mvn clean deploy  部署到nexus私服上。

相關推薦

Nexus搭建settings.xml配置詳細教程

配置: centos 7 安裝流程如下: # useradd nexus # passwd nexus $ su nexus $ cd $ wget nexus-3.12.1-01-unix.tar.gz && mkdir nexus3

Nexus搭建本地jar管理

環境準備與搭建 本地需要首先搭建好maven環境,在此基礎之上 下載nexus的檔案到本地,解壓後如圖顯示 修改nexus的配置檔案D:\worksoftware\nexus\nexus-2.11.4-01\conf\nexus.properties

nexus 搭建配置,並將自定義的jar釋出到

一、前言   為什麼要在本地開發機器上安裝nexus?首先宣告公司內部是有自己的nexus倉庫,但是對上傳jar包做了限制,不能暢快的上傳自己測試包依賴。於是就自己在本地搭建了一個nexus私服,即可以使用公司nexus私服倉庫中的依賴,也可以上傳和使用自己的測試包依賴。 二、nexus下載

Centos7.0下Nexus搭建

load 11.2 AD 下載 work tps class ash bundle 1.下載nexus wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundl

ava Maven項目之Nexus搭建和版本管理應用

max 權限 環境 val 導致 type www. exit frame 目錄: Nexus介紹 環境、軟件準備 Nexus服務搭建 Java Maven項目版本管理應用 FAQ 1、Nexus介紹 Nexus是一個強大的Maven倉庫管理器,它極大地簡化了自己內部

Nexus搭建及其核心功能

1、私服的使用場景    1)、公司不能連線公網,可以用一個私服務來統一連線    2)、公司內部jar 元件的共享 2、nexus下載與安裝    1)、下載nexus(nexus下載)    2)、解壓並設定環境變數 #解壓 tar -zxvf nexus-2.14.

精簡nexus搭建

  maven對專案原始碼和依賴管理的好處不言而喻,不過所依賴倉庫都是外網那些常用提供的倉庫地址,基於安全,當外網環境有限制,或私有共通jar需共享時,則會需要搭建內部私服,以下說明基於Linux環境。   1. maven 安裝   安裝很簡單,主要就幾個步驟和設定。   a.  w

Maven 搭建破解使用入門教程

Nexus下載 :https://blog.sonatype.com/   或下載我分享的 https://pan.baidu.com/s/1mEwkrTfg0dp3D7gJSEvueA 解壓:   破解: 將 &

關於android studio上maven搭建

1.首先jdk等必須的環境,maven在studio中自帶不需要下載配置 3.開啟目錄nexus-2.4.0-09-bundle\nexus-2.4.0-09\bin\jsw這個目錄下面你會發現有很多系統版本的nexus環境    我的電腦是win7 (64)為的

Linux nexus 搭建

sysconf default 防火墻 pre prope .so zxvf def har 下載nexushttps://www.sonatype.com/download-oss-sonatype 上傳到服務器/opt/ 解壓 tar -zxvf nexus-3.14.

Java Maven專案之Nexus搭建和版本管理應用

目錄: Nexus介紹 環境、軟體準備 Nexus服務搭建 Java Maven專案版本管理應用 FAQ 1、Nexus介紹 Nexus是一個強大的Maven倉庫管理器,它極大地簡化了自己內部倉庫的維護和外部倉庫的訪問。利用Nexus你可以只

GIT搭建GIT的使用

搭建git私服 安裝軟體git,percona資料庫 yum install git tar xvf Percona.tar yum install shared, server, client

Maven學習筆記二:Nexus搭建

Nexus是一種流行的Maven遠端倉庫,我們知道Maven一般有兩種倉庫,本地倉庫和遠端倉庫,中央倉庫是Maven自帶的遠端倉庫,除了中央倉庫之外,還存在許多特殊的遠端倉庫,私服便是一種特殊的遠端倉庫,使用私服的好處不言而喻:原本我們直接跟中央倉庫溝通的,現在在中間加入了

Nexus搭建

    Maven搭建眾所周知, 是一個很好的專案管理工具,預設情況下,我們下載第三方元件都是從MAVEN官網下載的。但是並不是所有的三方元件都可以在MAVEN官網找到,比如我們專案組自己內部的一些元件,可能要放在一個區域網伺服器上,並且向結合MAVEN使用,這時候我們就要

Maven和 Sonatype Nexus的安裝、配置使用入門

http://blog.csdn.net/congcong68/article/details/40273833Maven 在我們專案中能幫我們解決哪些問題:     1.輸入命令就會幫我們自動 編譯、執行單元測試、生成文件、打包和部署等,列如輸入mvn clean inst

MyEclipse 配置maven專案pom.xml設定 上傳專案到nexus,通過中轉倉庫下載外掛,以及nexus配置

1。安裝官方nexus的開源版本 下載安裝可以參照http://www.th7.cn/system/win/201609/179882.shtml 因為不是專業版本,有好多功能限制,不過個人用用夠了。 2。安裝maven 配置相對簡單:官方下載後解壓到安裝目錄即可。再在

CentOS7搭建Maven的Nexus倉庫

roo file use port centos *** https 裝包 jdk 1.下載nexus 打開一下鏈接: https://www.sonatype.com/nexus-repository-oss 下載安裝包。 2.解壓安裝包 tar zxvf nexus

nexus配置

不可 bubuko 關聯 包含 服務管理 nexus安裝 base prop 目錄 搭建環境:  騰訊雲服務器 CentOS 6.8、jdk7、sonatype nexus、maven、Xshell 5   版本信息:     jdk : jdk-7u80-linux-x6

maven介紹搭建

file 需求 緩存 項目 start epo -- 打開 for 1.Maven介紹Maven是款平臺的項目管理工具。主要服務於基於java平臺的項目構建,依賴管理和項目信息管理。2.Maven私服搭建環境介紹: 系統:Centos 7.4 64位、Jdk:1.8、mav

在pom.xml中使用distributionManagement將項目打包上傳到nexus

build 指定 mage 項目打包 admin hold set str eight 本文介紹 如何在pom.xml中使用distributionManagement將項目打包上傳到nexus私服1、pom.xml文件添加distributionManagement節點