Migrating Maven Components to Self-Hosted Repo in Batches
CodeArts Artifact provides batch migration tool to migrate Maven components from the Nexus server to CloudArtifact. This section describes how to migrate Maven components in batches.
The repositories and components to be migrated are as follows:
Prerequisites
- A private Maven repository has been created.
- This document is written based on the Python language, and the Nexus server must support Python2.
Obtaining CloudArtifact Address and Configuration File
- Obtain the repository address.
- Access the Self-Hosted Repo, and choose the target Maven repository in the left pane.
- Find the Repository Address. Click
to copy the address.
- Obtain the configuration file.
Downloading the Migration Tool to the Server
- Return to the Self-Hosted Repo homepage, and choose .
- Copy the downloaded .zip package to the server.
- Log in to the server and go to the directory where the .zip package is stored. Run the following commands to decompress the package and go to the directory generated after the decompression:
unzip Nexus2DevCloud.zip cd Nexus2DevCloud/
Configuring and Running the Migration
- Run the following command to start the migration tool script:
./NexusToDevcloud.py
The following configuration page is displayed.
If Permission denied is displayed, run the following command:
$ sudo chmod -R 777 ./NexusToDevcloud.py
or
$ sudo chmod 755 ./NexusToDevcloud.py
- Press i to start the initial configuration.
Press the letter before each line, enter the server configuration and CloudArtifact configuration, and press q to return to the previous page.
Configuration Item
Description
Nenux Data Directory
Enter the Nexus data directory on the server.
After you enter the directory, Nexus URL, Nexus Username, and Nexus Password may be displayed. Enter the values based on the site requirements.
DevCloud URL
Enter the address obtained in Obtaining CloudArtifact Address and Configuration File.
DevCloud Username
Enter the username obtained in Obtaining CloudArtifact Address and Configuration File.
DevCloud Password
Enter the password obtained in Obtaining CloudArtifact Address and Configuration File.
- Press r to go to the repository migration configuration page.
The repository list is displayed. Press the left or right arrow key to turn pages. Enter the repository ID to select or cancel the repository to be migrated. If a green + is displayed next to a repository name, the repository needs to be migrated. After the configuration is complete, press q to return to the previous page.
You can select only one host repository (that is, the repository ending with maven) for migration at a time.
- Press s to save the configuration (save the document as conf.json).
- Press v to verify the configuration. If the verification is successful, the following information is displayed:
- Press x to run the migration. If the following page is displayed, the migration is complete.
If the push fails, check whether the following configurations are correct:
- Check whether the network connection between the server and DevCloud is normal.
- Check whether the repository path is correct.
- Check whether the uploaded account and password are correct.
- Access CloudArtifact to view the migration result.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot