<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 功能強大 支持多語言、二開方便! 廣告
                ## 一、概述 GitHub Packages 是一種包管理服務,可讓你輕松地在源代碼旁邊發布公共包或專用包; ## 二、發布jar包到Maven倉庫 包發布到Maven中之后,只需要通過Maven的POM文件即可完成依賴的引入,無需再使用本地庫了,非常方便; ### **安裝和配置Maven** 這里基于獨立安裝,非常簡單,參考[開發工具/Maven/安裝配置](../Maven/%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE.md); ### **創建token** 在Settings>Developer settings>Personal access tokens里創建一個發布包的token,這個tokens應當能夠訪問repo的基本信息、讀寫、刪除packages; ![](https://img.kancloud.cn/f9/20/f92041d077f0b47bf13c4a3a6d4439df_1920x942.png) ![](https://img.kancloud.cn/f4/32/f4326c9dd53aaf05c2d1838e6a18b52a_1920x942.png) ![](https://img.kancloud.cn/a9/b3/a9b3cf0e1230b4504c173dcdc2927f9e_1920x942.png) 在Settings>Developer settings>Personal access tokens里創建一個安裝包的token,這個tokens應當能夠訪問repo的基本信息、讀; ![](https://img.kancloud.cn/db/3a/db3ab3014c33922fa24184354a1295e4_1920x942.png) ![](https://img.kancloud.cn/11/2e/112e1d3d4b65d821a7c0500bcb4d402c_1920x942.png) ``` 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 ``` ### **配置setting.xml** 可以直接用下面的配置內容覆蓋掉setting.xml: ``` <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.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <activeProfiles> <activeProfile>github</activeProfile> </activeProfiles> <profiles> <profile> <id>github</id> <repositories> <repository> <id>central</id> <url>https://repo1.maven.org/maven2</url> </repository> <repository> <id>github</id> <url>https://maven.pkg.github.com/4170804/raymaven</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <servers> <server> <id>github</id> <username>4170804</username> <password>${token}</password> </server> </servers> </settings> ``` >[danger] > 需要替代: ${token}: 上面創建token環節產生的token字符串,如果當前是發布環境,則需要配置發布環境讀寫token,如果只是使用,則只需要配置只讀的token; ### **配置工程POM** 需要發布包的工程POM文件中,加入 ``` <distributionManagement>? <repository>??? <id>github</id>??? <name>raymaven</name> <url>https://maven.pkg.github.com/4170804/raymaven</url> </repository> </distributionManagement> ``` ### **執行命令發布** 進入工程根目錄,執行命令: ``` cd D:\eclipseray\workspace\rayframework mvn clean mvn deploy -f pom.release.xml -e ``` ![](https://img.kancloud.cn/13/bb/13bb0eaff05059e99b119cabd34f3ca2_1239x647.png) 效果: ![](https://img.kancloud.cn/fa/18/fa180bb9a49551224281a28545103d91_1920x942.png) ![](https://img.kancloud.cn/41/33/4133bf656ff8acc86532dad4f7190f1c_1920x942.png) ![](https://img.kancloud.cn/0f/bf/0fbff298670357b4b5d8cbd1977457c0_1920x942.png) >[danger] > 1、打包的時候,用命令行,關掉eclipse,建議打包的過程,全程不要開eclipse; > 2、如果發布的時候,報證書錯誤,加入命令行看看:`-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true` ### **包設置為公共** 首次發布包時,默認可見性是私有的,只有您才能看到包。 您可以通過更改訪問設置來修改私有或公共容器映像的訪問權限; 公共包可以匿名訪問,無需身份驗證。 包一旦被設為公共,便無法再次將其設為私有。 在 GitHub 上,導航到用戶帳戶的主頁面Your Profile; 在個人資料頁面的右上角,單擊Packages,選擇指定的包; ![](https://img.kancloud.cn/e7/cf/e7cf28750cb8fe426e4d604979a4a27f_1920x942.png) 進入設置頁面的Danger Zone,更改包的可見性; ![](https://img.kancloud.cn/9e/a8/9ea8cbb65e61d28aeef7e9105637ce07_1920x942.png) 即可; ### **工程中引用** **配置文件:** 需要在eclipse中,配置Maven的全局設置,設定一個設置文件; ![](https://img.kancloud.cn/37/80/3780e0e42422410275131245ab2e7be6_669x594.png) 配置文件中的內容,可以直接復制下面的文本,完全覆蓋即可; ``` <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.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <activeProfiles> <activeProfile>github</activeProfile> </activeProfiles> <profiles> <profile> <id>github</id> <repositories> <repository> <id>central</id> <url>https://repo1.maven.org/maven2</url> </repository> <repository> <id>github</id> <url>https://maven.pkg.github.com/4170804/raymaven</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <servers> <server> <id>github</id> <username>4170804</username> <password>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</password> </server> </servers> </settings> ``` >[danger] token使用只讀的`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` > **工程的POM** 就可以如同公有倉庫里面的介質一樣,引入依賴即可; ``` <dependencies> <dependency> <groupId>org.ray</groupId> <artifactId>rayframework</artifactId> <version>3.0.1</version> </dependency> </dependencies> ``` 下載到本地庫效果: ![](https://img.kancloud.cn/64/29/6429920704f9bb31b5d553813fb450cf_1663x574.png) ## 三、前置條件 為了簡化發布庫包,把待發布的庫包的所有本地依賴包都打入了庫包,方便開發者只需要引入一個包即可; 因此,發布庫包前,需要把各依賴庫全部安裝到本地,方可,后續更新,只需更新本地包文件,即可自動更新本地依賴包了; 安裝本地包的方法參考:[本地包安裝](../Maven/%E6%9C%AC%E5%9C%B0%E5%8C%85%E5%AE%89%E8%A3%85.md) 需要安裝的包包括: ``` <!-- uniframework core libs start --> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.core</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.engine</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.integrate</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.internet</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.iot</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.open.core</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.ray.core</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.sysadmin</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.taglib</artifactId> <version>${uniframework.version}</version> </dependency> <dependency> <groupId>org.wbase</groupId> <artifactId>org.wbase.framework.oauth</artifactId> <version>${uniframework.version}</version> </dependency> <!-- uniframework core libs end --> ```
                  <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>

                              哎呀哎呀视频在线观看