bazel-contrib / bazel-contrib/rules_jvm_external

Overriding pinned artifacts from another pin file

Open
#398 5 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

I'm trying to find a way how to implement pinned artifact overrides. Currently, we have pinned deps in the central repo, and other repos load those pin files. But sometimes there's a need to override some of the centrally defined versions or add a repo-only dependency. Isolated artifact version trees are not sufficient for us, as we want to prevent the possibility of having the same artifact with different versions on a classpath. Having something like this would solve it:
```
maven_install(
name = "merged_deps",
maven_install_json = "@managed_maven_deps//:maven_install.json",
override_maven_install_json = "@localrepo_maven_deps//:maven_install.json",
)
```
Specifying `override_maven_install_json` would mean to update `maven_install_json` content with deps and versions from the override file.

I'm currently thinking of implementing such merging within a custom repository_rule, but it would be great if such feature lands in `rules_jvm_external`.

Contributor guide

Open the contributing guide

Research direction

Start with the maven_install entry point and its existing maven_install_json handling; the issue does not name a source file or test. Define how an override file should merge with the central file, including version conflicts and repository-only dependencies, then add coverage showing that the resulting artifact tree avoids duplicate versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.