Using JUnit5 in a Gradle project

Using JUnit5 in a Gradle project

To use JUnit5 in a Gradle project, I did the following in build.gradre and it worked.

Apparently, depending on the version of the junit-jupiter~ series and the version of the junit-platform-launcher, I cannot test JUnit5 well.

plugins {
  id 'java-library'

repositories {

test {
  useJUnitPlatform {
    includeTags 'fast'
    excludeTags 'slow'

dependencies {
  api 'org.apache.commons:commons-math3:3.6.1'
  implementation ''

  testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
  testImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
  testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'
  testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
Library Version
junit-jupiter-api 5.5.2
junit-jupiter-params 5.5.2
junit-jupiter-engine 5.5.2
junit-platform-launcher 1.5.2


Discover more from 株式会社CONFRAGE ITソリューション事業部

Subscribe now to keep reading and get access to the full archive.

Continue reading

Copied title and URL