ARTIFACTORY: How to Proxy a CPAN Repo with Artifactory?

Kfir Avraham
2021-11-28 09:54

Local CPAN repositories are not currently supported in Artifactory. However, proxying a remote CPAN endpoint can work, if you want to use Artifactory as pure cache endpoint for CPAN installations. For example a CPAN endpoint against

User-added image

After creating the remote repository, configure the CPAN client to use http://<ARTIFACTORY_URL>/artifactory/<REMOTE_REPO_KEY>. You can do this by invoking the 'cpan' command and using 'o conf init' to start the setup dialog, which will allow you to set up Artifactory as a repository.
Or another possibility is to set the 'urllist' field in the "" file to point to remote repository configured in Artifactory.

The cached files will preserve the original structure of the source repository, so the next time you make a request, CPAN will be able to retrieve the requested package from the Artifactory cache, instead of the remote endpoint.