Order inherited BOM precedence by the standard scope order
Some checks are pending
bld-ci / build (./bld, 17, macos-latest, false) (push) Waiting to run
bld-ci / build (./bld, 21, macos-latest, false) (push) Waiting to run
bld-ci / build (./bld, 25, macos-latest, false) (push) Waiting to run
bld-ci / build (./bld, 26, macos-latest, false) (push) Waiting to run
bld-ci / build (.\bld.bat, 17, windows-latest, false) (push) Waiting to run
bld-ci / build (.\bld.bat, 21, windows-latest, false) (push) Waiting to run
bld-ci / build (.\bld.bat, 25, windows-latest, false) (push) Waiting to run
bld-ci / build (.\bld.bat, 26, windows-latest, false) (push) Waiting to run
bld-ci / build (unittests, password, unittests, mariadb:10.9, mysql:8, gvenzl/oracle-free:latest, gvenzl/oracle-xe:18-slim, postgres:15, ./bld, 17, ubuntu-latest, true) (push) Waiting to run
bld-ci / build (unittests, password, unittests, mariadb:10.9, mysql:8, gvenzl/oracle-free:latest, gvenzl/oracle-xe:18-slim, postgres:15, ./bld, 21, ubuntu-latest, true) (push) Waiting to run
bld-ci / build (unittests, password, unittests, mariadb:10.9, mysql:8, gvenzl/oracle-free:latest, gvenzl/oracle-xe:18-slim, postgres:15, ./bld, 25, ubuntu-latest, true) (push) Waiting to run
bld-ci / build (unittests, password, unittests, mariadb:10.9, mysql:8, gvenzl/oracle-free:latest, gvenzl/oracle-xe:18-slim, postgres:15, ./bld, 26, ubuntu-latest, true) (push) Waiting to run
javadocs-pages / deploy (push) Waiting to run

This commit is contained in:
Geert Bevin 2026-07-17 08:01:07 -04:00
parent d7d176eef6
commit 7d77f48aec
2 changed files with 9 additions and 8 deletions

View file

@ -77,12 +77,13 @@ public class DependencyScopes extends LinkedHashMap<Scope, DependencySet> {
* {@code runtime} and {@code test} scopes, and the {@code runtime} and
* {@code provided} scope BOMs also apply to the {@code test} scope.
* The BOMs are returned with the scope's own BOMs first, followed by
* the inherited ones from the more specific to the more general scope,
* for the {@code test} scope that is {@code test}, {@code runtime},
* {@code provided}, {@code compile}. This order determines their
* precedence when several manage the same dependency: a BOM declared
* in the scope where a dependency is used takes precedence over a BOM
* that is inherited from a broader scope.
* the inherited ones in the standard scope order, for the {@code test}
* scope that is {@code test}, {@code compile}, {@code provided},
* {@code runtime}. This order determines their precedence when several
* manage the same dependency: a BOM declared in the scope where a
* dependency is used takes precedence over a BOM that is inherited from
* another scope, and among the inherited BOMs the more fundamental
* scope wins.
* <p>
* The {@code standalone} scope only uses its own BOMs, and its BOMs
* deliberately never apply to any other scope.
@ -106,7 +107,7 @@ public class DependencyScopes extends LinkedHashMap<Scope, DependencySet> {
return switch (scope) {
case provided -> new Scope[]{Scope.provided, Scope.compile};
case runtime -> new Scope[]{Scope.runtime, Scope.compile};
case test -> new Scope[]{Scope.test, Scope.runtime, Scope.provided, Scope.compile};
case test -> new Scope[]{Scope.test, Scope.compile, Scope.provided, Scope.runtime};
default -> new Scope[]{scope};
};
}

View file

@ -526,7 +526,7 @@ public class TestBom {
assertEquals(List.of(compile_bom), scopes.effectiveBoms(compile));
assertEquals(List.of(provided_bom, compile_bom), scopes.effectiveBoms(Scope.provided));
assertEquals(List.of(runtime_bom, compile_bom), scopes.effectiveBoms(Scope.runtime));
assertEquals(List.of(test_bom, runtime_bom, provided_bom, compile_bom), scopes.effectiveBoms(Scope.test));
assertEquals(List.of(test_bom, compile_bom, provided_bom, runtime_bom), scopes.effectiveBoms(Scope.test));
assertEquals(List.of(standalone_bom), scopes.effectiveBoms(Scope.standalone));
}