Install in Windows 10 environment.
Download from the official website below https://gradle.org/releases/ Download the latest version 4.8.1 as of July 16, 2018.
Expand to "D: \ gradle-4.8.1". Create the environment variable "GRADLE_HOME". Add "% GRADLE_HOME% \ bin" to your PATH. Exit when you can execute "gradle -version" at the command prompt.
Reference site: https://qiita.com/vvakame/items/83366fbfa47562fafbf4
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
bild.gradle
plugins {
id 'java'
}
repositories {
mavenCentral()
}
test {
useJUnitPlatform {
includeEngines 'junit-jupiter'
}
}
dependencies {
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.2.0'
testCompile "commons-io:commons-io:2.6"
testCompile "org.junit.jupiter:junit-jupiter-migrationsupport:5.2.0"
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.2.0'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
JUnit5 Refer to the following.
https://junit.org/junit5/docs/current/user-guide/ gradle -q test -PincTags=ABC
build.gradle
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
testCompile "commons-io:commons-io:2.6"
}
test {
useJUnitPlatform{
if (project.hasProperty('incTags')) {
includeTags incTags
}
if (project.hasProperty('excTags')) {
excludeTags excTags
}
}
testLogging {
events "passed", "skipped", "failed"
}
reports {
html.enabled = true
}
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '4.6'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
Jenkins
Add "clean test" and clean first to Task of gradle.
Recommended Posts