<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ## 一、安裝JDK和maven 我用的是jdk1.8.0_191和apache-maven-3.8.1,解壓到`/usr/local`目錄之后配置環境變量即可。 ~~~ export JAVA_HOME=/usr/local/jdk1.8.0_191; export CLASSPATH=.:${JAVA_HOME}/lib:$CLASSPATH; export PATH=${JAVA_HOME}/bin:$PATH; export MAVEN_HOME=/usr/local/apache-maven-3.8.1 export PATH=$MAVEN_HOME/bin:$PATH ~~~ 使用下面的命令驗證安裝結果,能夠正常輸出版本信息即安裝正確 ~~~ java -version; mvn -v; ~~~ ## 二、安裝nexus私有maven倉庫 首先解壓文件至一個目錄,我是用的非root用戶,就解壓到當前用戶的根目錄。 ~~~ tar -zxvf nexus-3.55.0-01-unix.tar.gz ~~~ 解壓之后有兩個文件夾,一個是nexus的安裝文件夾,另一個spnatype-work是工作文件夾(日志、數據、臨時文件都會存在這里)。 ![](https://img.kancloud.cn/5c/8a/5c8abb22aa67c8841fa89f5f332ebabf_141x29.png) 可以修改默認的端口號 ~~~ $ vim ./nexus-3.55.0-01/etc/nexus-default.properties application-port= //修改文件中該屬性為你的端口號,默認不改為8081 ~~~ 因為nexus存儲的數據量比較大,所以有些生產環境會單獨掛載一個盤符,比如:`/data`。如果我們需要將工作目錄放到這個目錄下,做如下操作 ~~~ # cd /data/ # mkdir nexusrepertory # chown -R xxxxx:xxxxxx nexusrepertory #這里xxxxx換成你自己的用戶和用戶組 # mv /home/xxxxx/sonatype-work /data/nexusrepertory ~~~ 目錄規劃好之后,我們還需要修改配置,告知nexus數據文件、日志文件的存放位置 ~~~ # cd /home/xxxxxx/nexus3/nexus-3.55.0-01/bin # vim nexus.vmoptions -XX:LogFile=/data/nexusrepertory/sonatype-work/nexus3/log/jvm.log -Dkaraf.data=/data/nexusrepertory/sonatype-work/nexus3 -Dkaraf.log=/data/nexusrepertory/sonatype-work/nexus3/log -Djava.io.tmpdir=/data/nexusrepertory/sonatype-work/nexus3/tmp ~~~ 完成以上操作我們就可以啟動nexus了。 ~~~ ./nexus-3.55.0-01/bin/nexus start ~~~ 全都配置完成之后訪問`http://ip:8081/`第一次訪問的時候速度非常慢,需要等一段時間,這個過程有可能你會認為沒有請求響應。初始化admin密碼在`$data-dir/sonatype-work/nexus3/admin.password`文件中。 第一次登陸之后會讓你修改admin密碼,修改完成之后會讓你選擇該庫是否允許匿名訪問。我們選擇不允許,如果內網比較安全可以設置為允許。 ![](https://img.kancloud.cn/e5/17/e51738c7e9bf995993eb04bcb9caf599_687x338.png) ## 三、新建一個proxy代理倉庫 代理倉庫(Proxy Repository)是遠程倉庫的代理,當用戶向這個代理倉庫請求一個依賴包時,這個代理倉庫會先在本地查找,如果存在,會直接提供給用戶進行下載;如果在代理倉庫本地查找不到,就會從配置的遠程中央倉庫中進行下載,下載到私服上之后再提供給用戶下載。所以一般我們把私服架設在內網之中,這樣可以節省外網帶寬,并且大大提高了用戶下載依賴的速度。 點擊"Repository"–>“Repositories”–>“Create repository”,選擇maven2(proxy)。 ![](https://img.kancloud.cn/f3/91/f391a0480a107dfae02026d2becd328e_803x759.png) ## 四、創建一個私有倉庫 點擊"Repository"–>“Repositories”–>“Create repository”,選擇maven2(hosted)。用戶可以把一些自己的構件上傳至宿主倉庫(Hosted Repository)中,比如自己封裝的一些工具類,在中央倉庫是找不到的。 ![](https://img.kancloud.cn/0a/8a/0a8a014deeff2fe2b4d68efc66075570_711x865.png) ## 五、歸于maven-public 當我們自己的新庫創建完畢時,要把新庫歸納到我們的版本庫中心:maven-public,這個庫是所有其他庫的中央庫,包含了其余所有庫的包,歸納操作步驟: ![](https://img.kancloud.cn/6a/5e/6a5e3333cf827f3d4e68c90470df8e2e_694x274.png) ![](https://img.kancloud.cn/18/8a/188a8ca881f443b0396f18a0fa02ef1f_970x331.png) ## 六、配置maven的settings.xml 打包部署的時候需要這個配置 ~~~ <server> <id>3rd_part</id> <!-- 注意這里的id一定要和你項目中的私服地址id一模一樣,如果這里的用戶名密碼寫錯了,會報錯:會報錯401, ReasonPhrase: Unauthorized. --> <username>admin</username> <password>Yhblsqt%21</password> </server> ~~~ ~~~ <mirror> <!--此處配置所有的構建均從私有倉庫中下載 *代表所有,也可以寫central --> <id>nexus3</id> <mirrorOf>*</mirrorOf> <url>http://10.60.100.26:55059/repository/maven-public/</url> </mirror> ~~~ ~~~ <profile> <id>nexus3</id> <repositories> <repository> <id>maven-public</id> <!-- 1111, 這里的id需和2222那里的一樣,在同一個profile里 --> <url>http://10.60.100.26:55059/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <!-- 這里是插件倉庫地址 --> <pluginRepository> <id>maven-public</id> <!-- 2222, 這里的id需和1111那里的一樣,在同一個profile里 --> <url>http://10.60.100.26:55059/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories> </profile> ~~~ https://www.cnblogs.com/zhuwenjoyce/p/10050922.html https://blog.csdn.net/Chen673328/article/details/122238786 https://blog.csdn.net/wc1695040842/category_9429349.html
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看