Try to use junit 5 with gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
apply plugin: 'java-library'
apply plugin: 'org.junit.platform.gradle.plugin'
...
Error:
Plugin with id 'org.junit.platform.gradle.plugin' not found.
Gradle version 4.0. What is wrong?
JUnit Jupiter is the combination of the programming model and extension model for writing tests and extensions in JUnit 5. The Jupiter sub-project provides a TestEngine for running Jupiter based tests on the platform. JUnit Vintage provides a TestEngine for running JUnit 3 and JUnit 4 based tests on the platform.
Specifies that JUnit Platform (a.k.a. JUnit 5) should be used to execute the tests. To configure JUnit platform specific options, see #useJUnitPlatform(Action) . Specifies that JUnit Platform (a.k.a. JUnit 5) should be used to execute the tests, configuring JUnit platform specific options.
You have to include a repositories
section outside the buildscript
block as well:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
apply plugin: 'java-library'
apply plugin: 'org.junit.platform.gradle.plugin'
repositories {
mavenCentral()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With