將 3rd 方 JAR 部署到遠程 Maven 庫

1. 安裝 Maven

下載地址

2. 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.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <pluginGroups></pluginGroups>

  <proxies></proxies>

  <servers>
    <server>
        <id>xxx_release</id>
        <username>Android</username>
        <password>xxx</password>
    </server>
    <server>
        <id>xxx_snapshot</id>
        <username>Android</username>
        <password>xxx</password>
    </server>
  </servers>

  <distributionManagement>
        <repository>
            <id>xxx_release</id> <!--四個id 要保持一致-->
           <url>https://nexus.xxx.city/repository/releases/</url>
        </repository>
        <snapshotRepository>
            <id>xxx_snapshot</id>
            <url>https://nexus.xxx.city/repository/snapshots/</url>
        </snapshotRepository>
  </distributionManagement>

  <mirrors></mirrors>

  <profiles></profiles>
</settings>

3. 執行傳包命令

官方文檔

mvn deploy:deploy-file 
-Dfile=/Users/cui/Downloads/hub-client-all-2022.2.14835.jar
-Dpackaging=jar 
-DgroupId=com.intellij.hub
-DartifactId=hub-client-all
-Dversion=2022.2.14835 
-DrepositoryId=xxx_release 
-Durl=https://nexus.xxx.city/repository/releases/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章