Setting up JUnit 5 dependency with Maven Example


If you want to make use of the JUnit 5 dependency with your Java project to write your test cases, you will need to add the below relevant dependency XML code in your pom.xml file.

Add in pom.xml file:
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.9.3</version>
    <scope>test</scope>
</dependency>

You can choose the version based on your requirements. You can find the list here: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api

Note: Make sure to load maven changes.

junit 5 example with maven
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap