Including JUnit 5 dependency in IntelliJ IDEA

Stav Alfi picture Stav Alfi · Mar 10, 2017 · Viewed 30.4k times · Source

From jetbrains blog:

IntelliJ IDEA supports the ability to actually run tests written for JUnit 5 – there’s no need to use the additional libraries (like the Gradle or Maven plugins for example), all you need is to include the JUnit 5 dependency.

I'm new to Java and IntelliJ IDEA and it's not clear to me what are the steps that I should do for making test using Junit 5.

Answer

CrazyCoder picture CrazyCoder · Mar 10, 2017

If your project is Maven or Gradle based, the dependency is added via pom.xml or build.gradle, otherwise you just add the .jar files to the Module Dependencies.

IDE can help you with that, press Alt+Enter on the red code:

add library

The following dependencies will be downloaded from the Maven repository and added to the classpath:

deps