Releasing Maven Components and Archiving to a Self-Hosted Repo
Background
CodeArts Artifact focuses on and manages the staging software packages (usually built by or packed from the source code) and their lifecycle metadata. The metadata includes basic properties such as the name and size, repository paths, code branch information, build tasks, creators, and build time. Throughout the development process, the software package is continuously refined across different versions.
The management of software packages and their properties is the basis of release management. Therefore, developers need to regularly review the version history of software packages.
Preparations
- You already have a project. If no project is available, create one.
- You have permissions for the current repository. For details, see Managing Repository Permissions.
Creating a Maven Repository and Associating It with a Project
- Log in to the CodeArts homepage and click a card to access a project.
- Choose from the navigation pane.
- Click , select Local Repository as the repository type, enter the repository name, and select Maven as the package type.
- Click Submit. The created Maven repository is displayed in the Repository View.
- In the Repository View, click the name of the target repository and click Settings.
- Click the Project Associations tab, click in the Operation column of the target project, and select target self-hosted repos in the displayed dialog box.
- Click OK.
Configuring Component Versions in Repo
- Log in to CodeArts and go to a created project.
- Choose on the top navigation bar.
- Click New Repository.
- Select a project from the Project drop-down list, select Template, and click Next.
- Search for the Java Maven Demo template, and click Next.
- Enter the repository name and click OK.
- Go back to Repo and click pom.xml to view the component configuration.
- On the component configuration page, the <version> field displays the version number of the current component. The default version number is 1.0.
Click in the upper right corner of the page to change the version number. Then, click OK to save the changes.
Releasing Maven Components to a Self-Hosted Repo Through CodeArts Build
- After configuring the component version in Repo, click Create Build Task in the upper right corner of the page.
- Select Blank Template and click OK.
- Click Add Build Actions. Search for and add the Build with Maven action.
- Edit the Build with Maven action.
- Select the desired tool version. In this example, maven3.5.3-jdk8-open is used.
- Find the following command and delete # in front of this command:
#mvn deploy -Dmaven.test.skip=true -U -e -X -B
Find the following command and add # in front of this command:mvn package -Dmaven.test.skip=true -U -e -X -B
- Select Configure all POMs under Release to Self-hosted Repos, and select the Maven repository associated with the project.
- Click Save and Run on the right of the page to start the build task.
Viewing Archived Components in the Version View of the Maven Repository
- Go to the self-hosted repo page, locate the target maven repository, and find the Maven component uploaded by build task.
Repeat the preceding steps to set the component version in Repo and archive components of multiple versions to self-hosted repos.
- Click the Version View tab.
In the package list, view the number of versions and the latest version of the package obtained from build tasks.
- Click a name in the Package Name column. The Overview page for the latest version of the package is displayed.
- Click the Files tab, click in the Operation column of the target component to download it to your local host.
- After modifying a component and setting a new version number, click Upload in the right of the target self-hosted repo to upload the latest version of the component.
The package list in the version view displays the latest uploaded version of each component and the number of archived versions.
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