OAK-12251: Consolidate test-scoped dependencies (Mockito, JUnit extras)#2945
OAK-12251: Consolidate test-scoped dependencies (Mockito, JUnit extras)#2945bhabegger wants to merge 1 commit into
Conversation
d9263c9 to
d105c21
Compare
5528377 to
e610c65
Compare
Moves test-only dependencies (JUnit, Mockito, EasyMock, OSGi mocks, testcontainers, slf4j-simple, pax-exam transitives) into a dedicated Test dependencies section in oak-parent dependencyManagement, with explicit scope=test on each entry. Also pins tinybundles to 3.0.0 to match the version required by both pax-exam 4.13.1 and sling.testing.paxexam 3.1.0. (pax-exam 4.14.0 uses the incompatible tinybundles 4.x API, so the OAK-12022 workaround pin in oak-store-composite is retained.)
e610c65 to
7edcde6
Compare
| <version>26.0.2-1</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
Moved, not removed, to group test dependencies together at end of depdendencyManagement.
There was a problem hiding this comment.
Frankly: I see almost nothing to do here.
Consolidating transitive test dependencies is actually pointless or hamful:
they vary with the dependency they come from; and that might actually be by design or needed
when they change: removal - we are left with noise in the parent pom; version change: we would actually have the incorect version.
That sounds like a maintenance nightmare to me.
Well, why not try it and see? Because from my experience managing dependencies is not such of nightmare at all, quite the contrary. |
|
And if it's such a crazy idea, why would this even exist ? And more, so why do projects rely on it ? |
Ahem? Seriously??? The problem is that scanners like these tend to report false positives. Uncritically acting on these actually can cause new problems, not to mention it creates noise in the POMs which is hard to maintain. Such as excluding things that might go away anyway (transitive Guava dependencies, for instance). Or considering annotation processors (errorprone) that are only used at compile time of the dependency. |
Centralises test dependency declarations in
oak-parentdependencyManagementunder a dedicated Test dependencies section, making it the single place to manage test library versions across all modules.What changes:
dependencyManagementsection.mockito.versionproperty (5.23.0) and pins Mockito's runtime transitives (byte-buddy,objenesis,asm) to matching versions.pax-swissbox-tracker1.9.0,tinybundles3.0.0,pax-url-commons) for deterministic resolution.oak-jcr,oak-lucene,oak-run,oak-run-commons,oak-search-elastic,oak-store-document, andoak-segment-azure— those modules now inherit versions from the parent.Scope: test infrastructure only; no changes to production code or OSGi bundle manifests.
JIRA: https://issues.apache.org/jira/browse/OAK-12251