From a7b599c8b44c565de8dc55a5cf09aa9ef07caf53 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 16 Apr 2021 18:41:43 +0200 Subject: [PATCH] update Gradle to 7.0 Had to disable java.modularity.inferModulePath, because JUnit was put on the module path and didn't want to start (class not found). Probably because I didn't have a module-info.java. --- build.gradle | 15 ++++++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index afc8375..48e85d3 100644 --- a/build.gradle +++ b/build.gradle @@ -35,9 +35,9 @@ sourceCompatibility = javaVersion * The shared configuration for all sub-projects: */ subprojects { - apply plugin: 'java' + apply plugin: 'java-library' apply plugin: 'eclipse' - apply plugin: 'maven' + //apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'me.champeau.gradle.jmh' @@ -79,6 +79,11 @@ subprojects { java { withSourcesJar() + + // Gradle 7.0 put half the dependencies on the module path. But without a module-info.java file + // JUnit didn't want to run because of a class not found error. By disabling modules we ensure + // all jars are put on the classpath. + modularity.inferModulePath.set(false) } @@ -86,8 +91,8 @@ subprojects { dependencies { testImplementation "org.junit.jupiter:junit-jupiter-api:${version_junit}" testImplementation "org.junit.jupiter:junit-jupiter-params:${version_junit}" // for @ParameterizedTest - testRuntime "org.junit.jupiter:junit-jupiter-engine:${version_junit}" - testRuntime "org.junit.platform:junit-platform-launcher:${version_junit_platform}" // needed by eclipse + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${version_junit}" + testRuntimeOnly "org.junit.platform:junit-platform-launcher:${version_junit_platform}" // needed by eclipse } test { @@ -103,5 +108,5 @@ subprojects { } wrapper { - gradleVersion = '6.8.3' + gradleVersion = '7.0' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d913..f371643 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists