ARTIFACTORY: How to Configure a Remote Repository in Artifactory to Download Artifacts from Saxonica Upstream

ARTIFACTORY: How to Configure a Remote Repository in Artifactory to Download Artifacts from Saxonica Upstream

AuthorFullName__c
Janardhana JL
articleNumber
000006247
ft:sourceType
Salesforce
FirstPublishedDate
2024-11-25T12:04:54Z
lastModifiedDate
2024-11-25
VersionNumber
5

How to Configure a Remote Repository in Artifactory to Download Artifacts from saxonica Upstream"

This article provides a step-by-step guide on how to configure a Generic Remote Repository in Artifactory to download artifacts from an external URL, in this case, from https://www.saxonica.com/download/java.xml.

You can download ZIP packages from the provided URL by adding the Saxonica upstream download link to a Generic Remote Repository in Artifactory. Follow the steps below to configure this setup in your Artifactory instance.

 

Steps to Configure the Remote Repository

1. Create a Generic Remote Repository
  • Log in to Artifactory
  • Navigate to the Repository Creation Page
  • Configure the Generic Remote Repository

    Remote URL: Set the remote URL to the base URL of the artifacts you want to download, for example:
    https://downloads.saxonica.com
     
  • Save: Click Save to create the remote repository.
    User-added image 

2. Test the Repository with a curl Command

Once your remote repository is created, you can use a curl command to download a specific artifact (e.g., the SaxonCS ZIP package) from the remote URL. Here’s an example of how to do it:

Example curl Command:

curl -uadmin:"Password*" "http://artifactory.com/artifactory/generic-remote/SaxonCS/11/SaxonCS-b6-11-4-1-Windows.zip" -O


Explanation:

  • In the above Curl Replace “admin” and "Password*" with your Artifactory username and password.
  • Replace generic-remote with the name of the remote repository you created earlier.
  • The URL "http://artifactory.com/artifactory/generic-remote/SaxonCS/11/SaxonCS-b6-11-4-1-Windows.zip" corresponds to the path of the artifact you want to download from the remote repository.
3. Verify the Download
After executing the above curl command, the ZIP package should begin downloading and cached successfully in the Artifactory remote cache repository.
total 135360
-rw-r--r--  1 janardhanaj  staff    41M Nov 19 12:14 SaxonCS-b6-11-4-1-Windows.zip


Logs in the Artifactory to validate the successful download:

==> artifactory-service.log <==

2024-11-23T07:37:39.975Z [jfrt ] [INFO ] [5d9d1ec95139658d] [o.a.r.HttpRepo:484] [http-nio-8081-exec-7] - Generic-remote downloading https://downloads.saxonica.com/SaxonCS/11/SaxonCS-b6-11-4-1-Windows.zip 41.50 MB 

2024-11-23T07:37:41.598Z [jfrt ] [INFO ] [5d9d1ec95139658d] [o.a.r.HttpRepo:497            ] [http-nio-8081-exec-7] - Generic-remote downloaded  https://downloads.saxonica.com/SaxonCS/11/SaxonCS-b6-11-4-1-Windows.zip 41.50 MB at 26,246.47 KB/sec

==> artifactory-request.log <==
2024-11-23T07:37:41.786Z|5d9d1ec95139658d|127.0.0.1|admin|GET|/Generic-remote/SaxonCS/11/SaxonCS-b6-11-4-1-Windows.zip|200|-1|43510735|2669|curl/8.7.1


4. Verify in Artifactory

Once the artifact is downloaded via the curl command, you should see the artifact cached in the Generic Remote Repository within Artifactory.
  • Navigate to the Artifacts tab in Artifactory
  • Browse to your generic-remote repository
  • You should see the downloaded ZIP files stored under the path you specified, e.g., SaxonCS/11/


Screenshot of Artifactory Cache:
Below is a screenshot from Artifactory showing the cached artifacts in the generic-remote repository after pulling them using the curl command.

User-added image 
 

 

Troubleshooting


If you encounter any issues with the repository configuration or the artifact download, here are some steps you can take to troubleshoot:
  1. Check the Repository URL: Ensure that the remote repository URL is correctly configured and reachable from your Artifactory instance.
  2. Review the Logs: Check the Artifactory logs to identify any connectivity or authentication issues.
  3. Check Permissions: Make sure that the user performing the curl command has the appropriate permissions to access the remote repository.
  4. Cache Configuration: If caching is enabled, verify that the cache is not expired and that the artifact is available in Artifactory’s cache.

 

Conclusion


By following these steps, you should be able to configure a Generic Remote Repository in Artifactory and successfully download artifacts from an external URL, such as https://downloads.saxonica.com. This setup allows you to cache external artifacts locally in Artifactory, and availability for future requests.