Skip to content

OAK-12251: Consolidate test-scoped dependencies (Mockito, JUnit extras)#2945

Open
bhabegger wants to merge 1 commit into
apache:OAK-12251from
bhabegger:OAK-12251-consolidate-test-deps
Open

OAK-12251: Consolidate test-scoped dependencies (Mockito, JUnit extras)#2945
bhabegger wants to merge 1 commit into
apache:OAK-12251from
bhabegger:OAK-12251-consolidate-test-deps

Conversation

@bhabegger

@bhabegger bhabegger commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Centralises test dependency declarations in oak-parent dependencyManagement under a dedicated Test dependencies section, making it the single place to manage test library versions across all modules.

What changes:

  • Moves JUnit (4.13.1 / JUnit BOM 5.14.2), Mockito, EasyMock, slf4j-simple, OSGi mocks, Testcontainers, pax-exam transitives, and misc test utilities into an explicit test-scoped dependencyManagement section.
  • Extracts a mockito.version property (5.23.0) and pins Mockito's runtime transitives (byte-buddy, objenesis, asm) to matching versions.
  • Pins pax-exam transitives (pax-swissbox-tracker 1.9.0, tinybundles 3.0.0, pax-url-commons) for deterministic resolution.
  • Removes redundant inline version declarations from oak-jcr, oak-lucene, oak-run, oak-run-commons, oak-search-elastic, oak-store-document, and oak-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

@bhabegger bhabegger force-pushed the OAK-12251-consolidate-test-deps branch 3 times, most recently from d9263c9 to d105c21 Compare June 11, 2026 05:43
@bhabegger bhabegger marked this pull request as ready for review June 11, 2026 05:45
@bhabegger bhabegger changed the base branch from trunk to OAK-12251 June 11, 2026 13:43
@thomasmueller thomasmueller requested a review from reschke June 11, 2026 13:49
@bhabegger bhabegger force-pushed the OAK-12251-consolidate-test-deps branch from 5528377 to e610c65 Compare June 12, 2026 13:02
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.)
@bhabegger bhabegger force-pushed the OAK-12251-consolidate-test-deps branch from e610c65 to 7edcde6 Compare June 12, 2026 13:08
Comment thread oak-parent/pom.xml
<version>26.0.2-1</version>
<scope>provided</scope>
</dependency>
<dependency>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved, not removed, to group test dependencies together at end of depdendencyManagement.

@reschke reschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://issues.apache.org/jira/browse/OAK-12251?focusedCommentId=18088232&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-18088232

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.

@reschke reschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(I believe this ticket should be closed as "Won't Do")

@bhabegger

bhabegger commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

https://issues.apache.org/jira/browse/OAK-12251?focusedCommentId=18088232&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-18088232

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.

@bhabegger

Copy link
Copy Markdown
Contributor Author

And if it's such a crazy idea, why would this even exist ?
https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html

And more, so why do projects rely on it ?
I've worked on projects where this is in place and it solves more issues than it creates.

@reschke

reschke commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

And if it's such a crazy idea, why would this even exist ?

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.

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.

2 participants