JUnit Maven Dependency

This page gives you a quick reference to get JUnit dependency for Maven or Gradle projects. You can also download the JUnit dependency, the link given at the "Download JAR File" section.
JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck.

JUnit maven dependency

Copy below JUnit maven dependency and paste in your project pom.xml file:
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>

JUnit Gradle dependency

Copy below JUnit Gradle dependency and paste in your project build.gradle file:
// https://mvnrepository.com/artifact/junit/junit
testCompile group: 'junit', name: 'junit', version: '4.12'

Download JAR File

Check for Latest Release

Reference



Comments