Skip to end of metadata
Go to start of metadata
Table of Contents

Overview

Artifactory allows you to define a virtual repository which is a collection of local, remote and other virtual repositories under a single logical URL.

A virtual repository hides the underlying repositories and lets users work with a single, well-known URL, while allowing you to change the participating repositories and their rules without requiring any client-side changes.

The main features supported by a virtual repository are:

  1. Nesting
  2. Include Exclude patterns filter
  3. Automatic removal of repository references
  4. WebStart automatic signing and JNLP file conversion

Setting Up a Virtual Repository

From the Admin tab go to Configuration -> Repositories -> Virtual Repositories and create a new virtual repository.

Add the repositories you want to be part of the virtual repositories to the virtual repository list of selected repositories.

The actual list of effectively resolved repositories (after expanding nested virtual repositories) is displayed and automatically updated.

The search/resolution order when requesting artifacts from a virtual repository is always:

  1. Local repositories
  2. Remote repository caches
  3. Remote repositories themselves.

Field NameDescription
Public DescriptionFree-text field description of the repository.
This description also appears when selecting the repository in the tree browser.
Internal NotesFree-text field for optional notes about this repository.
Includes Pattern

Comma-separated list of artifact patterns to include when evaluating artifact requests, in the form of x/y/**/z/*.

When used, only requests matching one the include patterns are served.

By default, all artifacts are included (**/*).

Excludes Pattern

Comma-separated list of artifact patterns to exclude when evaluating artifact requests, in the form of x/y/**/z/*.

By default, no artifacts are excluded.

RepositoriesA set of local and remote repository references to include in a virtual repository.
Resolved Repositories

The resolved list of repositories.

Repositories beginning with an exclamation mark ('!') indicate that not all tokens can be mapped between the layout of this virtual repository and the marked repository.

Path translations may not work as expected.


Nesting Virtual Repositories

The ability to nest virtual repositories is unique to Artifactory. It allows for greater reuse of virtual repositories between themselves.

Artifactory detects when overly nesting repositories enter an infinite loop and warns against it.

Include Exclude Patterns in Virtual Repositories

The coupling of Include/Exclude patterns of Artifactory Configuring Repositories to virtual repositories nesting provides a powerful feature.

You can define in a single virtual repository "remote-repos" the company groupId exclusion, and it ensures that no requests for internal artifacts are sent externally.

 Another example for this feature, is defining virtual repository for a project and filter undesirable groupId, sources or versions, that are not visible to developers.

Serving Requests from Other Artifactory Instances

By marking the 'Artifactory Requests Can Retrieve Remote Artifacts' checkbox, you can instruct Artifactory whether the virtual repository should include remote repositories in artifacts resolution when answering requests coming from other Artifactory instances. This is useful when deploying Artifactory in a mesh (grid) architecture, where you do not want all remote Artifactories to act as remote proxies for other Artifactory instances.

To control remote artifacts resolution for other Artifactory instances for the global virtual repository 'repo', you must use the artifactory.artifactoryRequestsToGlobalCanRetrieveRemoteArtifacts system property, which is set to false by default.

Field NameDescription
Repository LayoutSelect the layout that the repository should use for storing and identifying modules.
Artifactory Requests Can Retrieve Remote ArtifactsMark this checkbox to determine whether artifact requests arriving from other Artifactories can be fulfilled by accessing this virtual repository's remote repositories or by only accessing its caches (the default).
Cleanup Repository References in POMs(1) Discard Active References - Removes repository elements that are declared directly under project or under a profile in the same POM. By default, this is active.
(2) Discard Any References - Removes all repository elements regardless of whether they are included in an active profile or not.
(3) Nothing - Does not remove any repository elements declared in the POM.
Key PairA named key-pair to use for automatically signing artifacts.
Zap CachesClears all caches stored at the virtual repository level (transformed POMs, JNLP files, merged indexes, etc.)

Ensuring Artifactory is Your Sole Artifacts Provider

One very bad practice often used on public POMs, is to add a direct reference to an external repository in a POM. When either of the code examples below are present, Maven dynamically adds an external repository URL to the build.  This shortcuts Artifactory.

or

Until now, the solution was using mirrorOf as described here.

Artifactory provides at the virtual repository level, an automatic cleanup of POM file. Three levels of cleanup policy are configurable:

  1. Discard Active References - Removes repository elements that are declared directly under project or under a profile in the same pom that is activeByDefault.
  2. Discard Any References - Removes all repository elements regardless of whether they are included in an active profile or not.
  3. Nothing - Does not remove any repository elements declared in the POM.

Pre-canned Repositories

Artifactory comes with a set of per-defined virtual repositories, which reflect binary management best practices.

Repository Name
Purpose

remote-repos

Aggregation of all remote repositories

lib-releases

libs-releases-local, ext-releases and remote-repos

plugins-releases

plugins-releases-local, ext-releases and remote-repos

libs-snapshots

libs-snapshots-local, ext-snapshots-local, remote-repos

plugins-snapshots

plugins-snapshots-local, ext-snapshots-local, remote-repos

repo

Aggregation of all repositories

  • No labels