This topic describes how to manage artifacts in a Maven private repository.
Prerequisites
To manage artifacts in a Maven private repository, first create a Maven repository. For more information, see Create a repository.
Use a Maven repository
Click your Maven repository. In the navigation pane on the left, select User Guide and follow the instructions to configure pushing and pulling artifacts.
In the Credentials area, click the button to view your Maven username and password.
Select the Pull tab and follow these two steps to configure Maven to pull artifacts. Step 1: Set repository credentials. In the <servers> node of your settings.xml file, add a <server> element and specify the repository id, <username>, and <password>. Step 2: Configure repository information. In the <repositories> node, add a <repository> element, set the repository id and url, and set enabled for releases and snapshots to true or false as needed.
View and manage Maven artifacts
Search for artifacts
The repository homepage displays a list of all its artifacts. You can search for artifacts by name.
Manually upload an artifact
Click Upload Artifact to manually upload a local Maven artifact to the repository. In the Upload Artifact dialog box, correctly enter the Group, Artifactory, and Version information, select the correct packaging type, upload the local package file, and click Upload.
View artifact version details
Click an artifact's name to open its details panel. The panel displays details for the latest version by default, but you can switch to other versions. In the File list, you can download files such as pom and jar as needed.
The details panel on the right has two tabs: File information and Metadata. The File information tab shows artifact details (such as total versions, storage size, and tags) and version-specific details (such as who pushed the version and when). At the bottom of the panel are the Delete This Version button and the Disable Artifact switch.
Pull an artifact
When you click an artifact's name, its details panel appears. Here, you can find the configuration snippets for Maven or Gradle dependencies.
For example, in a Maven project, you manage all dependencies in the pom.xml file. The basic steps are:
-
Add a dependency: In the
<dependencies>section of yourpom.xmlfile, add the required<dependency>block. For example, to add a dependency for version "0.0.3-SNAPSHOT", add the following code:<dependencies> <dependency> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.3-SNAPSHOT</version> </dependency> </dependencies> -
Switch versions: To change a dependency's version, update the value in the
<version>element. -
Update dependencies: To resolve dependencies, run the following Maven command:
mvn dependency:resolveAlternatively, run a full project build to update dependencies:
mvn clean install
Disable an artifact version
In the artifact's details panel, click Disable Artifact to disable that version.
In the Enter the reason for disabling dialog box, enter a reason and click OK.
Disabling applies only to a specific version, not the entire artifact. For example, if you disable version 1.0 of an artifact on its details page, it can no longer be pulled, but other versions remain available.
Delete an artifact version
In the artifact details panel, click Metadata to manage the metadata of an artifact version. The metadata applies only to the specified version. Click Delete This Version to delete an artifact version. After an artifact version is deleted, you can restore it from the artifact recycle bin.