从 Nexus 迁移到 azure 工件

问题描述 投票:0回答:1

我必须将数千个包从 Nexus 迁移到 azure 工件。任何地方都没有关于此的正确信息,包括 Microsoft 文档。你能帮忙解决一下吗?我有 Maven、nuget 和其他自定义包。我了解天蓝色方面存在限制,并且想了解迁移将如何进行。

azure nexus azure-artifacts
1个回答
0
投票

为了将 Nexus 包迁移到 Azure 工件,请参阅此 MS 文档 和此 SO 答案

enter image description here

我参考了上面的 MS 文档并使用了示例 Java 项目 > 编辑了我的

pom.xml
,如下所示:-

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>MyGroup</groupId>
  <artifactId>myFirstApp</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>myFirstApp</name>
  <url>http://maven.apache.org</url>
  
  <repositories>
    <repository>
      <id>sid24desai0738</id>
      <url>https://pkgs.dev.azure.com/sid24desai0738/_packaging/sid24desai0738/maven/v1</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

通过添加 PAT 令牌来编辑

settings.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">

  <servers>
    <server>
      <id>sid24desai0738</id>
      <username>sid24desai0738</username>
      <password>grb5rmhexnkvaa4tewjr6birosck3hr4cpnbfez4i5y5uwaj42wq</password>
    </server>
  </servers>

</settings>

运行以下命令:-

mvn build
mvn install 
mvn deploy OR
mvn deploy -DaltDeploymentRepository=xxxxxx38::default::https://pkgs.dev.azure.com/xxxxx738/_packaging/sid24desai0738/maven/v1

enter image description here

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.