Skip to content

[mirror] build: keep junit 3.8.1 off the test classpath so the tests run - #4

Open
jdsika wants to merge 1 commit into
nextfrom
build/exclude-junit3-from-test-classpath
Open

jdsika wants to merge 1 commit into
nextfrom
build/exclude-junit3-from-test-classpath

Conversation

@jdsika

@jdsika jdsika commented Sep 26, 2026

Copy link
Copy Markdown

Mirror of upstream ShapeChange#799.

xmlunit-legacy 2.13.0 declares junit:junit 3.8.1 as a compile dependency,
for its JUnit 3 based classes (XMLTestCase, XMLAssert, Validator.assertIsValid).
Since maven-surefire-plugin 3.6.0 (ShapeChange#789), surefire adds the JUnit Vintage
engine to the test run whenever junit:junit is a test dependency; 3.5.6 did
not, because the project declares junit-jupiter-engine. The Vintage engine
rejects any junit:junit older than 4.12:

  TestEngine with ID 'junit-vintage' failed to discover tests
  Caused by: JUnitException: Unsupported version of junit:junit: 3.8.1.
  Please upgrade to version 4.12 or later.

The forked test JVM of shapechange-app therefore fails before a single test
executes, and `mvn test` reports "Tests run: 0" and a build failure there.
shapechange-core has no junit:junit and is not affected.

The tests use only xmlunit-legacy classes that do not depend on JUnit (Diff,
HTMLDocumentBuilder, TolerantSaxDocumentBuilder, XMLUnit and
jaxp13.Validator), and no test source uses JUnit 3 or 4. junit:junit is
therefore excluded from the xmlunit-legacy dependency, in
dependencyManagement so that it applies to every module that uses it.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika
jdsika force-pushed the build/exclude-junit3-from-test-classpath branch from 2482b17 to 9a457dc Compare September 26, 2026 11:26
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.

1 participant