Pass coursier credentials to private repositories - #154
Merged
Conversation
Users with artifacts on a private Artifactory got 401s from cellar while their sbt/Mill builds resolved fine. Two causes in coursier-interface: - 1.0.28 never read ~/.config/coursier/credentials.properties or COURSIER_CREDENTIALS (coursier/interface#460). Fixed upstream in 1.0.29-M4, so bump to it. - Even on 1.0.29-M4, ApiHelper.fetch gives the credential-bearing cache only to Resolve; Artifacts() keeps its default cache, so POMs authenticate but JAR downloads still fail with 401. Repository-level credentials travel with every artifact request, so read the same sources coursier does and attach them to each --repository whose host matches. Verified against a basic-auth Maven server: POM and JAR both download with only credentials.properties present. Also disable per-class test forking for lib.test: one JVM per test class, each booting a tasty-query Context, saturated the machine and made tests fail under load. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rochala
force-pushed
the
issue-artifactory
branch
from
August 29, 2026 11:31
1618af7 to
dc41ee8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Artifacts hosted on a private Artifactory fail with 401 in cellar while sbt/Mill builds using the same
~/.config/coursier/credentials.propertieswork.Causes (both in coursier-interface)
interface:1.0.28never readscredentials.properties/COURSIER_CREDENTIALS— coursier/interface#460, fixed in 1.0.29-M4 (#473).ApiHelper.fetchpasses the credential-bearing cache toResolvebut buildsArtifacts()with its default cache, so POMs authenticate and JAR downloads get 401. Reproduced by mimicking the construction with coursier core 2.1.25-M19; adding.withCache(cache0)fixes it (worth an upstream PR).Fix
io.get-coursier:interface→ 1.0.29-M4.CoursierCredentials: readsCOURSIER_CREDENTIALS(inline or file path) orcredentials.propertiesfromCOURSIER_CONFIG_DIR/XDG_CONFIG_HOME/~/.config/coursier/ macOS dir, and attaches host-matched credentials to each--repository(honourshttps-only). Repository-level auth reaches the JAR request regardless of the cache bug.lib.test.testParallelism = false: one forked JVM per test class saturated all cores and tests failed under load.Verification
credentials.properties: before → JAR 401; after → POM and JAR 401→200, symbol rendered. Same withCOURSIER_CREDENTIALS. With no credentials the error listsunauthorized: <url> (Artifactory Realm)under "Tried:"../mill __.test623/623,./mill __.fix --checkclean.Not yet confirmed against a real Artifactory — reporter should retry with this build.
🤖 Generated with Claude Code