Search code examples
junitjunit4ivyjunit5

Upgrading from JUnit 4 to JUnit 5 with Ivy(not Gradle or Maven)


I'm trying to update a legacy application that uses Ivy for dependency management from JUnit 4.12 to JUnit 5 and haven't found anything that doesn't rely on Gradle or Maven. Because of our non-standard, byzantine build/deploy process, I can't use one of those tools yet (we're working on it), currently I have:

<dependency org="junit" name="junit" rev="4.12"/>

I've tried:

<dependency org="junit" name="junit" rev="5.2.0"/>
<dependency org="junit5" name="junit5" rev="5.2.0"/>
<dependency org="junit" name="junit" rev="5.1.0"/>

and a few similar things.

Has anyone been able to update to JUnit 5 using Ivy or are we just stuck with 4 until we get with the program and switch to Gradle/Maven?


Solution

  • JUnit 5 is modularized (see User Guide).

    You need at least junit-jupiter-api to compile your tests:

    <dependency org="org.junit" name="junit-jupiter-api" rev="5.2.0"/>