From d5f0bb23aed29578cb45653f14d291d1bfe291e7 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 2 Jan 2020 15:21:40 +0100 Subject: [PATCH] Disable publication of test fixture artifacts Thanks to @melix for providing the code snippet necessary to achieve this with Gradle 5.6.x. See gh-23550 --- gradle/spring-module.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gradle/spring-module.gradle b/gradle/spring-module.gradle index ad6ed3168f1..5c513b976e3 100644 --- a/gradle/spring-module.gradle +++ b/gradle/spring-module.gradle @@ -55,6 +55,14 @@ task javadocJar(type: Jar) { publishing { publications { mavenJava(MavenPublication) { + // Disable publication of test fixture artifacts. + // + // Once we upgrade to Gradle 6.x, we will need to delete the following line ... + components.java.variants.removeAll { it.outgoingConfiguration.name.startsWith("testFixtures") } + // ... and uncomment the following two lines. + // components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() } + // components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() } + from components.java artifact sourcesJar artifact javadocJar