feat: Add strategy for artifactory #31
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Implements a strategy for caching packages stored in Artifactory. This caching strategy supports both path based and host based URL's.
Why?
Artifactory is a commonly used package store that requires first class support.
Tests
Implemented unit testing. Additionally the following manual testing has been performed with various Build tools.
Added a test configuration...
Add an entry to
/etc/hosts...NPM
Result from second-run post-caching:
Gems
time gem install rack --clear-sources --source http://gems.local:8080/ --install-dir ./vendor --no-document --version 2.2.3 Fetching rack-2.2.3.gem Successfully installed rack-2.2.3 1 gem installed real 0m25.421s user 0m14.404s sys 0m0.229sPyPi
Maven
Add a settings.xml...
mvn dependtiee mncy:get -s settings.xml -DgroupId=commons-lang -DartifactId=commons-lang -Dversion=2.6 -Dtransitive=false [INFO] Scanning for projects... Downloading from cachew-proxy: http://test.local:8080/artifactory/common/org/codehaus/mojo/maven-metadata.xml Downloading from cachew-proxy: http://test.local:8080/artifactory/common/org/apache/maven/plugins/maven-metadata.xml Downloaded from cachew-proxy: http://test.local:8080/artifactory/common/org/codehaus/mojo/maven-metadata.xml (21 kB at 4.1 kB/s) Downloaded from cachew-proxy: http://test.local:8080/artifactory/common/org/apache/maven/plugins/maven-metadata.xml (10 kB at 2.1 kB/s) Downloading from cachew-proxy: http://test.local:8080/artifactory/common/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.pom Downloaded from cachew-proxy: http://test.local:8080/artifactory/common/org/apache/maven/plugins/maven-dependency-plugin/3.7.0/maven-dependency-plugin-3.7.0.pom (19 kB at 3.7 MB/s) ... SNIP ... Downloaded from cachew-proxy: http://test.local:8080/artifactory/common/commons-lang/commons-lang/2.6/commons-lang-2.6.jar (284 kB at 271 kB/s) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.070 s [INFO] Finished at: 2026-01-16T13:31:31+11:00 [INFO] ------------------------------------------------------------------------ real 0m7.828s user 0m3.924s sys 0m0.790s