Releasing a Maven Artifact to a Self-Hosted Repo via a Build Task
Background
CodeArts Artifact focuses on and manages the staging 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 URLs, code branch information, build tasks, creators, and build time. Throughout the development process, packages are continuously refined across different versions.
The management of packages and their properties is the basis of release management. Therefore, developers need to regularly review the version history of packages.
Prerequisites
- You have purchased a CodeArts package.
- You already have a project. If no project is available, create one. For example, create a project named project01.
- 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 Create Repository in the upper right corner of the page, select Local Repo, enter the repository name maven01, and set Package Type to Maven.
- Click OK. The created Maven repository is displayed in the Repo View.
- In the Repo View, click the repository name maven01 and click Settings.
- Click the Project Associations tab, click
in the Operation column of the project, and select target self-hosted repo maven01 in the displayed dialog box.
- Click OK.
Configuring Package Versions in CodeArts Repo
- Log in to CodeArts and go to project01.
- Choose on the top navigation bar.
- Click New Repository.
- Select project01 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 repo01 and click OK.
- Go back to Repo and click pom.xml to view the package configuration.
- On the package configuration page, the <version> field displays the version number of the current package. 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 a Maven Artifact to a Self-Hosted Repo Through CodeArts Build
- After configuring the package 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 maven01 associated with the project.
- Click Save and Execute in the upper right corner of the page to execute build task.
Viewing Packages in the Version View of the Maven Repository
- Go to the self-hosted repo page, locate the target maven repository, and find the Maven artifact uploaded by build task.
Repeat the preceding steps to set the package version in Repo and archive packages 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 the build task.
- 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 package to download it to the localhost.
- After modifying a package and setting a new version number, click Upload in the right of the target self-hosted repo to upload the latest version of the package.
The package list in the Version View displays the latest uploaded version of each package 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