Skip to content

[2.x] feat: Add csrLocalArtifactsShouldBeCached setting for caching local artifacts#8504

Merged
eed3si9n merged 1 commit intosbt:developfrom
MkDev11:feature/local-artifacts-cache-7547
Jan 13, 2026
Merged

[2.x] feat: Add csrLocalArtifactsShouldBeCached setting for caching local artifacts#8504
eed3si9n merged 1 commit intosbt:developfrom
MkDev11:feature/local-artifacts-cache-7547

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented Jan 12, 2026

Add csrLocalArtifactsShouldBeCached setting

Problem

Currently, sbt-coursier does not expose Coursier's FileCache.localArtifactsShouldBeCached setting. This makes it impossible for users to configure whether local file:// artifacts should be copied to the cache directory.

This is particularly problematic for scenarios like SIP 46 / Scala CLI integration, where compiler artifacts are bundled in a local repository for offline use. Without this setting, users cannot ensure that local artifacts are properly cached.

Solution

This PR adds a new sbt setting csrLocalArtifactsShouldBeCached that controls whether local file artifacts should be cached by Coursier.

Usage

// In build.sbt
csrLocalArtifactsShouldBeCached := true

When enabled, artifacts from local file:// repositories will be copied to the Coursier cache directory, making them available for offline use and consistent with remote artifact handling.

Changes

  • Added localArtifactsShouldBeCached field to CoursierConfiguration
  • Added csrLocalArtifactsShouldBeCached setting key in sbt
  • Wired the setting through to Coursier's FileCache configuration
  • Added scripted test to verify the feature

Fixes #7547


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147

…rtifacts

This adds a new setting  that allows users to
configure Coursier's FileCache to cache local file:// artifacts. When enabled,
artifacts from local repositories are copied to the cache directory, which is
useful for scenarios like bundling compiler artifacts in a local repo for
offline use.

Fixes sbt#7547
Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks for the contribution!

@eed3si9n eed3si9n changed the title feat: Add csrLocalArtifactsShouldBeCached setting for caching local artifacts [2.x] feat: Add csrLocalArtifactsShouldBeCached setting for caching local artifacts Jan 13, 2026
@eed3si9n eed3si9n merged commit 81b6408 into sbt:develop Jan 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sbt-coursier does not enable configuration of the FileCache.localArtifactsShouldBeCached setting

2 participants