JetBrains Space Help

Mirror Remote Repositories

Space Packages support two mirroring scenarios:

Supported repository types

Pull-through cache

Publishing to remote repos

Cargo (Rust)

Supported

Not supported

Container

Supported

Supported

Composer

Not supported

Not supported

Dart

Supported

Not supported

Maven

Supported

Supported

NuGet

Not supported

Supported

npm

Supported

Not supported

Python Package Index

Supported

Not supported

Pull-through cache mirror

A pull-through cache mirror lets you:

  • Simplify referencing packages from remote repositories: One local mirror repository can mirror multiple remote repositories. Note that a remote repository doesn't necessarily represent an external repository. This could also be a local repository hosted in Space. For example, you can create a mirror that aggregates data from Maven Central and a local repository with private artifacts.

  • Optimize network traffic: For example, a mirror can speed up Space Automation builds as all external packages will be available locally.

When a user references a package from a repository mirror, Space checks if the package is available locally. If the package is not available, Space will download it from the associated remote repository and save it locally in the mirror.

Note that you cannot publish packages to pull-through cache mirrors: You will receive the 405 status code from the server: Method Not Allowed.

To create a pull-through cache mirror

  1. Navigate to the project where you want to create a mirror.

  2. On the project sidebar, choose Packages.

  3. On the Packages page, click New repository.

  4. In the New Package Repository window, specify repository settings: Type, Name, and Description.

  5. Choose Mirror an existing repository.

  6. In the mirror properties, specify the URL of the remote repository and Authentication type.

  7. Depending on the Authentication type, specify required authentication settings.

  8. The Artifact name patterns option lets you specify which packages from the remote repository will be available in the mirror. Specify the required exclude or include patterns with + or - correspondingly. The asterisk * wildcard is allowed. For example, to include only packages related to Kotlin: +com.jetbrains.kotlin.*

  9. After you create the mirror, click the Get Started button to see the command-line snippets that will help you get started: connect to the repository and get images. Here you can also Generate personal token for accessing the mirror.

To associate a mirror with additional remote repositories

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click New remote repository and specify repository settings:

    • Type: Choose a repository type.

      • Remote: a repository that is external to Space.

      • Space: a local repository hosted in Space Packages.

    • For a Remote repository, specify its URL and authentication credentials.

    • For a repository hosted in Space, specify the project the repository belongs to and the repository itself.

    • Prevent dependency hijacking: Enable/disable protection from dependency hijacking. Learn more

  5. Click Create.

To disable package caching for a particular remote repository

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click Menu next to the required repository and choose Edit.

  5. Clear the Enable package downloading checkbox and click Save.

Preventing dependency hijacking

Mirrors in Packages provide built-in protection from dependency hijacking. By default, if a mirror downloads a package from a remote repository once, it will use only this remote repository for all further package updates. If you disable Prevent dependency hijacking for this repository, Space will look for the updates in all associated remote repositories.

To disable protection from hijacking for a remote repository

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click Menu next to the required repository and choose Edit.

  5. Clear the Prevent dependency hijacking checkbox and click Save.

To change a remote repository used for package updates

  1. Find the required package.

  2. Click Versions.

  3. Choose a new remote repository in the Look for new versions in list.

    Protection from dependency hijacking

    After this, Space will look for new package versions only in the newly specified repository.

Publishing packages to remote repositories

In some cases, you might need to publish a package stored in a Space Packages repository to a remote repository, for example, Maven Central. For each local repository, you can specify a list of related remote repositories. After this, you can publish packages from the local repository to any of these remote repositories.

To associate a local repository with remote repositories

  1. Navigate to the project which contains the required local repository.

  2. On the project sidebar, choose Packages.

  3. Find the required repository and click Settings Settings.

  4. In the repository settings, open the Remote Repositories tab.

  5. Add at least one remote repository by clicking New remote repository.

  6. In the mirror properties, specify the URL of the remote repository and Authentication type.

  7. Depending on the Authentication type, specify required authentication settings.

To publish packages to a remote repository from a local repository

  1. Find the required package.

  2. In the package menu, choose Publish to remote repository.

    Publish a package to mirror
  3. In the list, select a required mirror and click Publish.

Last modified: 08 May 2023