From 547373d6fd62eda767ce2d2ebe38d409416a4206 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Fri, 18 Aug 2023 16:25:22 +0100 Subject: [PATCH 01/18] Starting code to include jdks --- .../gradle/dist/service/DistTarTask.java | 6 +++++ .../JavaServiceDistributionExtension.java | 24 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java index 09566949c..176a8ce9a 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java @@ -53,6 +53,12 @@ static void configure( t.setFileMode(0755); }); + distributionExtension.getJdks().get().forEach((javaVersion, jdk) -> { + root.from(jdk, t -> { + t.into("service/jdk" + javaVersion.getMajorVersion()); + }); + }); + root.into("service/lib", t -> { t.from(jarTask); t.from(project.getConfigurations().named("runtimeClasspath")); diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java index fd28280d9..084766181 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java @@ -23,6 +23,8 @@ import groovy.lang.DelegatesTo; import java.util.List; import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; import javax.annotation.Nullable; import javax.inject.Inject; import org.gradle.api.Action; @@ -48,6 +50,7 @@ public class JavaServiceDistributionExtension extends BaseDistributionExtension private final ListProperty defaultJvmOpts; private final ListProperty excludeFromVar; private final MapProperty env; + private final MapProperty jdks; private final ObjectFactory objectFactory; @@ -63,7 +66,16 @@ public JavaServiceDistributionExtension(Project project) { .getTargetCompatibility())); mainClass = objectFactory.property(String.class); + jdks = objectFactory.mapProperty(JavaVersion.class, Object.class).empty(); + javaHome = objectFactory.property(String.class).value(javaVersion.map(javaVersionValue -> { + Optional possibleIncludedJdk = + Optional.ofNullable(jdks.getting(javaVersionValue).getOrNull()); + + if (possibleIncludedJdk.isPresent()) { + return "service/jdk" + javaVersionValue.getMajorVersion(); + } + boolean javaVersionLessThanOrEqualTo8 = javaVersionValue.compareTo(JavaVersion.VERSION_1_8) <= 0; if (javaVersionLessThanOrEqualTo8) { return ""; @@ -85,7 +97,13 @@ public JavaServiceDistributionExtension(Project project) { excludeFromVar = objectFactory.listProperty(String.class); excludeFromVar.addAll("log", "run"); - env = objectFactory.mapProperty(String.class, String.class).empty(); + env = objectFactory.mapProperty(String.class, String.class); + env.putAll(project.provider(() -> { + return jdks.get().entrySet().stream() + .collect(Collectors.toMap( + entry -> "$JAVA_" + entry.getKey().getMajorVersion() + "_HOME", + entry -> "service/jdk" + entry.getKey().getMajorVersion())); + })); setProductType(ProductType.SERVICE_V1); } @@ -213,6 +231,10 @@ public final void setEnv(Map env) { this.env.set(env); } + public final MapProperty getJdks() { + return jdks; + } + public final Provider getGc() { return gc; } From 2fe82166ea56a5384e0221fbd65e444bd0787c69 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 14:28:39 +0100 Subject: [PATCH 02/18] Test that jdk inclusion works --- gradle-sls-packaging/build.gradle | 1 + .../service/JdksInDistsIntegrationSpec.groovy | 104 ++++++++++++++++++ versions.lock | 2 + versions.props | 1 + 4 files changed, 108 insertions(+) create mode 100644 gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy diff --git a/gradle-sls-packaging/build.gradle b/gradle-sls-packaging/build.gradle index a1095c8a5..49253c17c 100644 --- a/gradle-sls-packaging/build.gradle +++ b/gradle-sls-packaging/build.gradle @@ -31,6 +31,7 @@ dependencies { testImplementation 'com.netflix.nebula:nebula-test' testImplementation 'org.awaitility:awaitility' testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.rauschig:jarchivelib' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine' } diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy new file mode 100644 index 000000000..46572168d --- /dev/null +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -0,0 +1,104 @@ +/* + * (c) Copyright 2023 Palantir Technologies Inc. All rights reserved. + */ + +package com.palantir.gradle.dist.service + +import nebula.test.IntegrationSpec +import org.rauschig.jarchivelib.ArchiveFormat +import org.rauschig.jarchivelib.ArchiverFactory +import org.rauschig.jarchivelib.CompressionType + + +class JdksInDistsIntegrationSpec extends IntegrationSpec { + def setup() { + // language=gradle + settingsFile << ''' + rootProject.name = 'myService' + '''.stripIndent(true) + + // language=gradle + buildFile << ''' + apply plugin: 'java' + apply plugin: 'com.palantir.sls-java-service-distribution' + + repositories { + maven { + url 'https://artifactory.palantir.build/artifactory/release-jar' + metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } + } + mavenLocal() + } + + group 'group' + version '1.0.0' + '''.stripIndent(true) + + file('versions.lock') + + // language=java + writeJavaSourceFile ''' + package app; + + import java.nio.file.Files; + import java.nio.file.Paths; + + public class Main { + public static void main(String... args) {} + } + '''.stripIndent(true) + + file('build/fake-jdk/release') << 'its a jdk trust me' + def java = file('build/fake-jdk/bin/java') << ''' + #!/bin/bash + echo "Hello" + echo "JAVA_17_HOME=$JAVA_17_HOME" + '''.stripIndent(true) + + java.setExecutable(true) + } + + def 'puts jdk in dist'() { + // language=gradle + buildFile << ''' + distribution { + javaVersion JavaVersion.VERSION_17 + jdks.put(JavaVersion.VERSION_17, fileTree('build/fake-jdk')) + } + '''.stripIndent(true) + + when: + runTasksSuccessfully('distTar') + + then: + def rootDir = extractDist() + def jdkDir = new File(rootDir, "service/jdk17") + jdkDir.exists() + + def releaseFileText = new File(jdkDir, "release").text + + releaseFileText.contains 'its a jdk trust me' + + def launcherStatic = new File(rootDir, "service/bin/launcher-static.yml").text + launcherStatic.contains 'javaHome: "service/myService-1.0.0-jdks/jdk17"' + + // Only contains a linux amd64 JDK, will only run on CI + if ("true" == System.getenv("CI")) { + "${rootDir}/service/bin/init.sh start".execute([], rootDir).waitFor() == 0 + + def startupLog = new File(rootDir, "var/logs/output.log") + startupLog.text.contains "Hello" + startupLog.text.contains "JAVA_17_HOME=service/myService-1.0.0-jdks/jdk17" + } + } + + private File extractDist() { + def slsTgz = new File(projectDir, "build/distributions/myService-1.0.0.sls.tgz") + def extracted = new File(slsTgz.getParent(), "extracted") + + ArchiverFactory.createArchiver(ArchiveFormat.TAR, CompressionType.GZIP) + .extract(slsTgz, extracted) + + return new File(extracted, "myService-1.0.0") + } +} diff --git a/versions.lock b/versions.lock index 9c03567bf..e1a85c5c1 100644 --- a/versions.lock +++ b/versions.lock @@ -44,6 +44,7 @@ org.yaml:snakeyaml:2.0 (1 constraints: 3a178910) cglib:cglib-nodep:3.2.2 (1 constraints: 490ded24) com.netflix.nebula:nebula-test:10.0.0 (1 constraints: 3305273b) junit:junit:4.13.2 (3 constraints: a523497e) +org.apache.commons:commons-compress:1.21 (1 constraints: f70aebc8) org.apiguardian:apiguardian-api:1.1.2 (6 constraints: 896455cc) org.awaitility:awaitility:4.2.0 (1 constraints: 08050536) org.codehaus.groovy:groovy:3.0.6 (2 constraints: 1e1b476d) @@ -58,5 +59,6 @@ org.junit.platform:junit-platform-engine:1.10.0 (3 constraints: ac2e4dc4) org.junit.vintage:junit-vintage-engine:5.10.0 (1 constraints: 3805413b) org.objenesis:objenesis:2.4 (1 constraints: ea0c8c0a) org.opentest4j:opentest4j:1.3.0 (2 constraints: cf209249) +org.rauschig:jarchivelib:1.2.0 (1 constraints: 0505f635) org.spockframework:spock-core:2.0-M4-groovy-3.0 (2 constraints: e822d65a) org.spockframework:spock-junit4:2.0-M4-groovy-3.0 (1 constraints: 25115ddf) diff --git a/versions.props b/versions.props index cfe876614..c4f2c304d 100644 --- a/versions.props +++ b/versions.props @@ -9,6 +9,7 @@ org.apache.commons:commons-lang3 = 3.13.0 org.immutables:value = 2.9.3 org.junit.jupiter:* = 5.10.0 org.junit.vintage:* = 5.10.0 +org.rauschig:jarchivelib = 1.2.0 com.netflix.nebula:nebula-test = 10.0.0 junit:junit = 4.13.2 From c77fc6c0515dee4dc5779be0738549870299675c Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 14:51:07 +0100 Subject: [PATCH 03/18] Correct location for jdk --- .../gradle/dist/service/DistTarTask.java | 2 +- .../JavaServiceDistributionExtension.java | 20 +++++++++++++++++-- .../service/JdksInDistsIntegrationSpec.groovy | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java index 176a8ce9a..7352ad588 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java @@ -55,7 +55,7 @@ static void configure( distributionExtension.getJdks().get().forEach((javaVersion, jdk) -> { root.from(jdk, t -> { - t.into("service/jdk" + javaVersion.getMajorVersion()); + t.into(distributionExtension.jdkPathInDist(javaVersion)); }); }); diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java index 084766181..0bef8b1bb 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java @@ -73,7 +73,7 @@ public JavaServiceDistributionExtension(Project project) { Optional.ofNullable(jdks.getting(javaVersionValue).getOrNull()); if (possibleIncludedJdk.isPresent()) { - return "service/jdk" + javaVersionValue.getMajorVersion(); + return jdkPathInDist(javaVersionValue); } boolean javaVersionLessThanOrEqualTo8 = javaVersionValue.compareTo(JavaVersion.VERSION_1_8) <= 0; @@ -102,7 +102,7 @@ public JavaServiceDistributionExtension(Project project) { return jdks.get().entrySet().stream() .collect(Collectors.toMap( entry -> "$JAVA_" + entry.getKey().getMajorVersion() + "_HOME", - entry -> "service/jdk" + entry.getKey().getMajorVersion())); + entry -> jdkPathInDist(entry.getKey()))); })); setProductType(ProductType.SERVICE_V1); } @@ -271,4 +271,20 @@ private static GcProfile getDefaultGcProfile(JavaVersion javaVersion) { } return new GcProfile.Throughput(); } + + final String jdkPathInDist(JavaVersion javaVersionValue) { + // We put the JDK in a directory that contains the name and version of service. This is because in our cloud + // environments (and some customer environments), there is a third party security scanning tool that will report + // vulnerabilities in the JDK by printing a path, but does not display symlinks. This means it's hard to tell + // from a scan report which service is actually vulnerable, as our internal deployment infra uses symlinks, + // and you end up with a report like so: + // Path: /opt/palantir/services/.24710105/service/jdk17 + // rather than more useful: + // Path: /opt/palantir/services/.24710105/service/multipass-2.1.3-jdks/jdk17 + // which is implemented below. + + return String.format( + "service/%s-%s-jdks/jdk%s", + getDistributionServiceName().get(), project.getVersion(), javaVersionValue.getMajorVersion()); + } } diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 46572168d..cdc6c6f15 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -72,7 +72,7 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { then: def rootDir = extractDist() - def jdkDir = new File(rootDir, "service/jdk17") + def jdkDir = new File(rootDir, "service/myService-1.0.0-jdks/jdk17") jdkDir.exists() def releaseFileText = new File(jdkDir, "release").text From 99d5cca64d7c9bb89353a9b6ceaaa44030413745 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 15:35:34 +0100 Subject: [PATCH 04/18] Maven central --- .../gradle/dist/service/JdksInDistsIntegrationSpec.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index cdc6c6f15..342e2c987 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -23,11 +23,7 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { apply plugin: 'com.palantir.sls-java-service-distribution' repositories { - maven { - url 'https://artifactory.palantir.build/artifactory/release-jar' - metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } - } - mavenLocal() + mavenCentral() } group 'group' From 01d938d9c4d544f3c653feab7188c938ebdc09df Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 15:45:31 +0100 Subject: [PATCH 05/18] startup log --- .../gradle/dist/service/JdksInDistsIntegrationSpec.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 342e2c987..96747be17 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -82,7 +82,7 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { if ("true" == System.getenv("CI")) { "${rootDir}/service/bin/init.sh start".execute([], rootDir).waitFor() == 0 - def startupLog = new File(rootDir, "var/logs/output.log") + def startupLog = new File(rootDir, "var/logs/startup.log") startupLog.text.contains "Hello" startupLog.text.contains "JAVA_17_HOME=service/myService-1.0.0-jdks/jdk17" } From 31ea4c0075fb671d4a8772447b4b1687af6e65b6 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 15:56:00 +0100 Subject: [PATCH 06/18] Correct env vars --- .../JavaServiceDistributionExtension.java | 2 +- .../service/JdksInDistsIntegrationSpec.groovy | 46 +++++++++++++++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java index 0bef8b1bb..ef2c9e973 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java @@ -101,7 +101,7 @@ public JavaServiceDistributionExtension(Project project) { env.putAll(project.provider(() -> { return jdks.get().entrySet().stream() .collect(Collectors.toMap( - entry -> "$JAVA_" + entry.getKey().getMajorVersion() + "_HOME", + entry -> "JAVA_" + entry.getKey().getMajorVersion() + "_HOME", entry -> jdkPathInDist(entry.getKey()))); })); setProductType(ProductType.SERVICE_V1); diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 96747be17..1e0f91596 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -77,14 +77,50 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { def launcherStatic = new File(rootDir, "service/bin/launcher-static.yml").text launcherStatic.contains 'javaHome: "service/myService-1.0.0-jdks/jdk17"' + launcherStatic.contains ' JAVA_17_HOME: "service/myService-1.0.0-jdks/jdk17"' // Only contains a linux amd64 JDK, will only run on CI - if ("true" == System.getenv("CI")) { - "${rootDir}/service/bin/init.sh start".execute([], rootDir).waitFor() == 0 + if ("true" != System.getenv("CI")) { + return + } + + "${rootDir}/service/bin/init.sh start".execute([], rootDir).waitFor() == 0 + + def startupLog = new File(rootDir, "var/logs/startup.log") + startupLog.text.contains 'Hello' + startupLog.text.contains 'JAVA_17_HOME=service/myService-1.0.0-jdks/jdk17' + } + + def 'multiple jdks can exist in the dist'() { + // language=gradle + buildFile << ''' + distribution { + javaVersion JavaVersion.VERSION_17 + jdks.put(JavaVersion.VERSION_11, fileTree('build/fake-jdk')) + jdks.put(JavaVersion.VERSION_13, fileTree('build/fake-jdk')) + jdks.put(JavaVersion.VERSION_17, fileTree('build/fake-jdk')) + } + '''.stripIndent(true) + + when: + runTasksSuccessfully('distTar') + + then: + def rootDir = extractDist() + + def launcherStatic = new File(rootDir, "service/bin/launcher-static.yml").text + launcherStatic.contains 'javaHome: "service/myService-1.0.0-jdks/jdk17"' + + for (version in [11, 13, 17]) { + def jdkDir = new File(rootDir, "service/myService-1.0.0-jdks/jdk" + version) + assert jdkDir.exists() + + def releaseFileText = new File(jdkDir, "release").text + + assert releaseFileText.contains('its a jdk trust me') - def startupLog = new File(rootDir, "var/logs/startup.log") - startupLog.text.contains "Hello" - startupLog.text.contains "JAVA_17_HOME=service/myService-1.0.0-jdks/jdk17" + def envVarLine = " JAVA_${version}_HOME: \"service/myService-1.0.0-jdks/jdk${version}\"" + assert launcherStatic.contains(envVarLine) } } From 1902a5db7fa797e3997013fe58d33f650b96d9a1 Mon Sep 17 00:00:00 2001 From: svc-changelog Date: Mon, 21 Aug 2023 15:21:18 +0000 Subject: [PATCH 07/18] Add generated changelog entries --- changelog/@unreleased/pr-1510.v2.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/@unreleased/pr-1510.v2.yml diff --git a/changelog/@unreleased/pr-1510.v2.yml b/changelog/@unreleased/pr-1510.v2.yml new file mode 100644 index 000000000..f3332ae9e --- /dev/null +++ b/changelog/@unreleased/pr-1510.v2.yml @@ -0,0 +1,6 @@ +type: feature +feature: + description: Add `jdks` property to `distribution` extension to help include JDKs + into dists. + links: + - https://github.com/palantir/sls-packaging/pull/1510 From 7fe3a3a71fe8fa23789af3936e49117c55ed4c47 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Mon, 21 Aug 2023 16:24:30 +0100 Subject: [PATCH 08/18] Remove silly remote only test --- .../service/JdksInDistsIntegrationSpec.groovy | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 1e0f91596..7c0de1bc8 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -45,13 +45,6 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { '''.stripIndent(true) file('build/fake-jdk/release') << 'its a jdk trust me' - def java = file('build/fake-jdk/bin/java') << ''' - #!/bin/bash - echo "Hello" - echo "JAVA_17_HOME=$JAVA_17_HOME" - '''.stripIndent(true) - - java.setExecutable(true) } def 'puts jdk in dist'() { @@ -78,17 +71,6 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { def launcherStatic = new File(rootDir, "service/bin/launcher-static.yml").text launcherStatic.contains 'javaHome: "service/myService-1.0.0-jdks/jdk17"' launcherStatic.contains ' JAVA_17_HOME: "service/myService-1.0.0-jdks/jdk17"' - - // Only contains a linux amd64 JDK, will only run on CI - if ("true" != System.getenv("CI")) { - return - } - - "${rootDir}/service/bin/init.sh start".execute([], rootDir).waitFor() == 0 - - def startupLog = new File(rootDir, "var/logs/startup.log") - startupLog.text.contains 'Hello' - startupLog.text.contains 'JAVA_17_HOME=service/myService-1.0.0-jdks/jdk17' } def 'multiple jdks can exist in the dist'() { From 1727248f9633543b33aed8bf4586491ec4068770 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Wed, 23 Aug 2023 17:03:20 +0100 Subject: [PATCH 09/18] Ensure we are lazy enough --- .../gradle/dist/service/DistTarTask.java | 12 ++++++---- .../service/JdksInDistsIntegrationSpec.groovy | 24 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java index 7352ad588..49083b410 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java @@ -16,7 +16,9 @@ package com.palantir.gradle.dist.service; +import java.util.Arrays; import java.util.concurrent.Callable; +import org.gradle.api.JavaVersion; import org.gradle.api.Project; import org.gradle.api.file.DuplicatesStrategy; import org.gradle.api.provider.Provider; @@ -53,10 +55,12 @@ static void configure( t.setFileMode(0755); }); - distributionExtension.getJdks().get().forEach((javaVersion, jdk) -> { - root.from(jdk, t -> { - t.into(distributionExtension.jdkPathInDist(javaVersion)); - }); + Arrays.stream(JavaVersion.values()).forEach(javaVersion -> { + root.from( + distributionExtension.getJdks().getting(javaVersion).orElse(project.provider(project::files)), + t -> { + t.into(distributionExtension.jdkPathInDist(javaVersion)); + }); }); root.into("service/lib", t -> { diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 7c0de1bc8..c8a5b4d2a 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -106,6 +106,30 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { } } + def 'does not force value of jdks at configuration time'() { + // language=gradle + buildFile << ''' + distribution { + javaVersion JavaVersion.VERSION_17 + jdks.putAll(provider { + println('hello ' + state.isConfiguring()) + if (state.isConfiguring()) { + throw new RuntimeException("Should not be called when configuring") + } + return Map.of(JavaVersion.VERSION_17, fileTree('build/fake-jdk')) + }) + } + + tasks.getByName('distTar') + '''.stripIndent(true) + + when: + runTasksSuccessfully('distTar') + + then: + 1 == 1 + } + private File extractDist() { def slsTgz = new File(projectDir, "build/distributions/myService-1.0.0.sls.tgz") def extracted = new File(slsTgz.getParent(), "extracted") From d182d6a32d0fd8f3f1b4e8ae7aa31ef723c9af9b Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:14:15 +0100 Subject: [PATCH 10/18] Improved test --- .../dist/service/JdksInDistsIntegrationSpec.groovy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index c8a5b4d2a..65ae40f97 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -106,7 +106,7 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { } } - def 'does not force value of jdks at configuration time'() { + def 'does not force value of jdks at configuration time when task is evaluated'() { // language=gradle buildFile << ''' distribution { @@ -120,6 +120,9 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { }) } + // Quite a lot of internal plugins/build.gradles unfortunately get the distTar task non-lazily. An internal + // piece of infra sets the jks property by resolving a configuration, which cannot happen at configuration + // time. tasks.getByName('distTar') '''.stripIndent(true) @@ -127,7 +130,11 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { runTasksSuccessfully('distTar') then: - 1 == 1 + def rootDir = extractDist() + + // A way of fixing this tests seems to open up the possibility of making extra unnecessary JDK repos - ensure + // this does not happen. + !new File(rootDir, "service/myService-1.0.0-jdks/jdk11").exists() } private File extractDist() { From 4a6a5b77b5364a4e8ae36bd4156924617af16940 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:14:49 +0100 Subject: [PATCH 11/18] format --- .../dist/service/JdksInDistsIntegrationSpec.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 65ae40f97..0dbdbf8bd 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -1,5 +1,17 @@ /* * (c) Copyright 2023 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.palantir.gradle.dist.service From ca1f2989f6a1cecfeafd120e9008297ab2260046 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:30:21 +0100 Subject: [PATCH 12/18] comment --- .../java/com/palantir/gradle/dist/service/DistTarTask.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java index 49083b410..c0607f43f 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/DistTarTask.java @@ -55,6 +55,13 @@ static void configure( t.setFileMode(0755); }); + // We do this trick of iterating through every java version and making a from with a lazy value to be lazy + // enough to handle the case where another plugin has set the value of the jdks property based on the result + // of resolving a configuration. Unfortunately, lots of our internal plugins/build.gradle force the value + // of the distTar task at configuration time, so this would cause a Configuration to resolved at + // configuration time (which is disallowed) with the naive getting the value from the property and looping + // over it. Reading the code below, you might be concerned that it would create empty directories for unset + // java versions, but Gradle does not appear to do this for empty file collections. Arrays.stream(JavaVersion.values()).forEach(javaVersion -> { root.from( distributionExtension.getJdks().getting(javaVersion).orElse(project.provider(project::files)), From a7b64817a893d1b2f140639692621c77ee4722e2 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:33:42 +0100 Subject: [PATCH 13/18] less provider wrapping --- .../dist/service/JavaServiceDistributionExtension.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java index ef2c9e973..ce863e119 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java @@ -98,12 +98,10 @@ public JavaServiceDistributionExtension(Project project) { excludeFromVar.addAll("log", "run"); env = objectFactory.mapProperty(String.class, String.class); - env.putAll(project.provider(() -> { - return jdks.get().entrySet().stream() - .collect(Collectors.toMap( - entry -> "JAVA_" + entry.getKey().getMajorVersion() + "_HOME", - entry -> jdkPathInDist(entry.getKey()))); - })); + env.putAll(jdks.map(jdksValue -> jdksValue.entrySet().stream() + .collect(Collectors.toMap( + entry -> "JAVA_" + entry.getKey().getMajorVersion() + "_HOME", + entry -> jdkPathInDist(entry.getKey()))))); setProductType(ProductType.SERVICE_V1); } From e2329a3d1b6f3069967a3dc3c7e0bf0aa1b332d5 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:54:04 +0100 Subject: [PATCH 14/18] don't allow users to clear the java home env vars --- .../JavaServiceDistributionExtension.java | 5 ---- .../JavaServiceDistributionPlugin.java | 20 +++++++++++++- .../service/JdksInDistsIntegrationSpec.groovy | 26 ++++++++++++++++++- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java index ce863e119..969060439 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionExtension.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.stream.Collectors; import javax.annotation.Nullable; import javax.inject.Inject; import org.gradle.api.Action; @@ -98,10 +97,6 @@ public JavaServiceDistributionExtension(Project project) { excludeFromVar.addAll("log", "run"); env = objectFactory.mapProperty(String.class, String.class); - env.putAll(jdks.map(jdksValue -> jdksValue.entrySet().stream() - .collect(Collectors.toMap( - entry -> "JAVA_" + entry.getKey().getMajorVersion() + "_HOME", - entry -> jdkPathInDist(entry.getKey()))))); setProductType(ProductType.SERVICE_V1); } diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java index 2ea336d5c..068bd81a6 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java @@ -35,6 +35,8 @@ import java.nio.file.Path; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import java.util.stream.Collectors; import org.gradle.api.Action; import org.gradle.api.InvalidUserCodeException; @@ -222,7 +224,7 @@ public void execute(Task _task) { task.getAddJava8GcLogging().set(distributionExtension.getAddJava8GcLogging()); task.getJavaHome().set(distributionExtension.getJavaHome()); task.getJavaVersion().set(distributionExtension.getJavaVersion()); - task.getEnv().set(distributionExtension.getEnv()); + task.getEnv().set(userConfiguredEnvWithJdkEnvVars(distributionExtension)); }); TaskProvider initScript = project.getTasks() @@ -323,6 +325,22 @@ public void execute(Task _task) { project.getArtifacts().add(SlsBaseDistPlugin.SLS_CONFIGURATION_NAME, distTar); } + private static Provider> userConfiguredEnvWithJdkEnvVars( + JavaServiceDistributionExtension distributionExtension) { + + return distributionExtension.getEnv().zip(distributionExtension.getJdks(), (userConfiguredEnv, jdks) -> { + Map actualEnv = new HashMap<>(userConfiguredEnv); + + jdks.forEach((javaVersion, _ignored) -> { + actualEnv.put( + "JAVA_" + javaVersion.getMajorVersion() + "_HOME", + distributionExtension.jdkPathInDist(javaVersion)); + }); + + return Collections.unmodifiableMap(actualEnv); + }); + } + private static void replaceManifestClasspath(Path windowsScript, String manifestClassPathArchiveFileName) throws IOException { // Replace standard classpath with pathing jar in order to circumnavigate length limits: diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy index 0dbdbf8bd..c69a50554 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JdksInDistsIntegrationSpec.groovy @@ -133,7 +133,7 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { } // Quite a lot of internal plugins/build.gradles unfortunately get the distTar task non-lazily. An internal - // piece of infra sets the jks property by resolving a configuration, which cannot happen at configuration + // piece of infra sets the jdks property by resolving a configuration, which cannot happen at configuration // time. tasks.getByName('distTar') '''.stripIndent(true) @@ -149,6 +149,30 @@ class JdksInDistsIntegrationSpec extends IntegrationSpec { !new File(rootDir, "service/myService-1.0.0-jdks/jdk11").exists() } + def 'even a user clearing env does not get rid of JAVA_XX_HOME env vars'() { + // language=gradle + buildFile << ''' + distribution { + javaVersion JavaVersion.VERSION_17 + jdks.put(JavaVersion.VERSION_17, fileTree('build/fake-jdk')) + jdks.put(JavaVersion.VERSION_11, fileTree('build/fake-jdk')) + + env.empty() + } + '''.stripIndent(true) + + when: + runTasksSuccessfully('distTar') + + then: + def rootDir = extractDist() + + def launcherStatic = new File(rootDir, "service/bin/launcher-static.yml").text + + launcherStatic.contains 'JAVA_11_HOME: "service/myService-1.0.0-jdks/jdk11"' + launcherStatic.contains 'JAVA_17_HOME: "service/myService-1.0.0-jdks/jdk17"' + } + private File extractDist() { def slsTgz = new File(projectDir, "build/distributions/myService-1.0.0.sls.tgz") def extracted = new File(slsTgz.getParent(), "extracted") From e82137d2ced51fbdccac275b5306da1bc7139db9 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:55:56 +0100 Subject: [PATCH 15/18] let's try to keep a consistent order --- .../gradle/dist/service/JavaServiceDistributionPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java index 068bd81a6..8c4c7a6cd 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java @@ -331,7 +331,7 @@ private static Provider> userConfiguredEnvWithJdkEnvVars( return distributionExtension.getEnv().zip(distributionExtension.getJdks(), (userConfiguredEnv, jdks) -> { Map actualEnv = new HashMap<>(userConfiguredEnv); - jdks.forEach((javaVersion, _ignored) -> { + jdks.keySet().stream().sorted().forEach(javaVersion -> { actualEnv.put( "JAVA_" + javaVersion.getMajorVersion() + "_HOME", distributionExtension.jdkPathInDist(javaVersion)); From 1a256d929fa1a2f1d4286a9389cecf2f41227354 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 15:58:04 +0100 Subject: [PATCH 16/18] LinkedHashMap to maintain order - tricksy ordering issues --- .../gradle/dist/service/JavaServiceDistributionPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java index 8c4c7a6cd..9384b4c42 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/JavaServiceDistributionPlugin.java @@ -35,7 +35,7 @@ import java.nio.file.Path; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Collectors; import org.gradle.api.Action; @@ -329,7 +329,7 @@ private static Provider> userConfiguredEnvWithJdkEnvVars( JavaServiceDistributionExtension distributionExtension) { return distributionExtension.getEnv().zip(distributionExtension.getJdks(), (userConfiguredEnv, jdks) -> { - Map actualEnv = new HashMap<>(userConfiguredEnv); + Map actualEnv = new LinkedHashMap<>(userConfiguredEnv); jdks.keySet().stream().sorted().forEach(javaVersion -> { actualEnv.put( From 0a345810d9f8cd1c1b0194ff1f7df3869b56ebd8 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 16:05:18 +0100 Subject: [PATCH 17/18] Bump up minimum gradle version. `Provider#zip` is introduced in 6.6. However, it seems that gradle introduced plugin bytecode rewriting sometime between 6.1 and 6.6. This means it now falls over on the jackson 2.15.2 dep, so we need to go all the way to 7.6 --- .../com/palantir/gradle/dist/SlsBaseDistPlugin.java | 2 +- .../JavaServiceDistributionPluginTests.groovy | 13 ------------- .../MainClassInferenceIntegrationSpec.groovy | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/SlsBaseDistPlugin.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/SlsBaseDistPlugin.java index e7d599462..f58c21c50 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/SlsBaseDistPlugin.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/SlsBaseDistPlugin.java @@ -31,7 +31,7 @@ public class SlsBaseDistPlugin implements Plugin { public static final String SLS_DIST_USAGE = "sls-dist"; - public static final GradleVersion MINIMUM_GRADLE = GradleVersion.version("6.1"); + public static final GradleVersion MINIMUM_GRADLE = GradleVersion.version("7.6"); @Override public final void apply(Project project) { diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JavaServiceDistributionPluginTests.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JavaServiceDistributionPluginTests.groovy index 75d2609a6..105229125 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JavaServiceDistributionPluginTests.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/JavaServiceDistributionPluginTests.groovy @@ -179,7 +179,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } @@ -219,7 +218,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } @@ -599,7 +597,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } distribution { @@ -633,7 +630,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } version '0.0.1' @@ -678,7 +674,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } version '0.0.1' @@ -797,7 +792,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { args "hello" } repositories { - jcenter() mavenCentral() } dependencies { @@ -813,7 +807,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { id 'java-library' } repositories { - jcenter() mavenCentral() } dependencies { @@ -932,7 +925,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { enableManifestClasspath true } repositories { - jcenter() mavenCentral() } dependencies { @@ -948,7 +940,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { id 'java-library' } repositories { - jcenter() mavenCentral() } dependencies { @@ -1031,7 +1022,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } @@ -1066,7 +1056,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } @@ -1101,7 +1090,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } @@ -1385,7 +1373,6 @@ class JavaServiceDistributionPluginTests extends GradleIntegrationSpec { project.group = 'service-group' repositories { - jcenter() mavenCentral() } diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/MainClassInferenceIntegrationSpec.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/MainClassInferenceIntegrationSpec.groovy index 5fc19204f..e5a958fdd 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/MainClassInferenceIntegrationSpec.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/MainClassInferenceIntegrationSpec.groovy @@ -34,7 +34,6 @@ class MainClassInferenceIntegrationSpec extends GradleIntegrationSpec { } repositories { - jcenter() mavenCentral() } From ae709cd434b5e47711aaf50eb1e73d2e3795b090 Mon Sep 17 00:00:00 2001 From: Callum Rogers Date: Thu, 24 Aug 2023 18:03:33 +0100 Subject: [PATCH 18/18] Bump GCV --- .../src/test/groovy/com/palantir/gradle/dist/Versions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/Versions.java b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/Versions.java index 7a56bcf68..c5fcd52f6 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/Versions.java +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/Versions.java @@ -18,7 +18,7 @@ public final class Versions { - public static final String GRADLE_CONSISTENT_VERSIONS = "1.27.0"; + public static final String GRADLE_CONSISTENT_VERSIONS = "2.15.0"; private Versions() {} }