Migration from Nexus to azure artifacts

47 views Asked by At

I have to migrate thousands of packages from Nexus to azure artifacts. There is no proper information anywhere on this including Microsoft documentation. can you please help with approach? I have maven ,nuget and other custom packages. I understand there are limitations on azure side and would like to understand how the migration would work.

1

There are 1 answers

5
SiddheshDesai On

In order to migrate Nexus packages to Azure artifact refer this MS Document and this SO answer.

enter image description here

I referred above MS document and used the sample Java project > Edited my pom.xml like below:-

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

Edit settings.xml by adding the PAT token with

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

Ran the commands below:-

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