From e6f5284ac4616ea9bd027950ceda93fe8991e14a Mon Sep 17 00:00:00 2001 From: Burt Beckwith Date: Thu, 29 Feb 2024 11:23:01 -0500 Subject: [PATCH] 4.2.1-2 release (#18) --- gcn/buildSrc/src/main/groovy/gcn-base.gradle | 2 +- .../gcn/command/GcnCommonOptionsMixin.java | 2 +- .../cloud/graal/gcn/GcnGeneratorContext.java | 16 +++++---- .../main/java/cloud/graal/gcn/GcnUtils.java | 35 ++++++++++--------- .../misc/template/ApacheNotice.rocker.raw | 2 +- ...cnDefaultPomDependencyVersionResolver.java | 6 ++-- .../service/streaming/AwsStreaming.java | 2 +- .../tracing/AbstractTracingFeature.java | 7 +++- .../feature/service/tracing/AwsTracing.java | 6 ++-- .../feature/service/tracing/GcpTracing.java | 6 ++-- .../service/tracing/NonCloudTracing.java | 6 ++-- .../feature/service/tracing/OciTracing.java | 6 ++-- .../template/BuildGradlePostProcessor.java | 19 ++++++++++ .../gcn/template/MavenPomPostProcessor.java | 21 ----------- gcn/gcn-core/src/main/resources/version.txt | 1 + gcn/gradle/wrapper/gradle-wrapper.properties | 2 +- gcn/version.txt | 1 - 17 files changed, 77 insertions(+), 63 deletions(-) create mode 100644 gcn/gcn-core/src/main/resources/version.txt delete mode 100644 gcn/version.txt diff --git a/gcn/buildSrc/src/main/groovy/gcn-base.gradle b/gcn/buildSrc/src/main/groovy/gcn-base.gradle index f212234..466c805 100644 --- a/gcn/buildSrc/src/main/groovy/gcn-base.gradle +++ b/gcn/buildSrc/src/main/groovy/gcn-base.gradle @@ -19,7 +19,7 @@ plugins { id 'maven-publish' } -version = new File(rootProject.projectDir, 'version.txt').text.trim() +version = new File(rootProject.projectDir, 'gcn-core/src/main/resources/version.txt').text.trim() group = 'gcn' ext.micronautVersion = new File(rootProject.projectDir, 'gcn-core/src/main/resources/micronautVersion.txt').text.trim() diff --git a/gcn/gcn-cli/src/main/java/cloud/graal/gcn/command/GcnCommonOptionsMixin.java b/gcn/gcn-cli/src/main/java/cloud/graal/gcn/command/GcnCommonOptionsMixin.java index 936866b..1e2e15c 100644 --- a/gcn/gcn-cli/src/main/java/cloud/graal/gcn/command/GcnCommonOptionsMixin.java +++ b/gcn/gcn-cli/src/main/java/cloud/graal/gcn/command/GcnCommonOptionsMixin.java @@ -50,7 +50,7 @@ public class GcnCommonOptionsMixin { */ public static class GcnVersionProvider implements IVersionProvider { public String[] getVersion() { - return new String[]{"GCN Version: " + GcnUtils.getMicronautVersion()}; + return new String[]{"GCN Version: " + GcnUtils.getVersion()}; } } } diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnGeneratorContext.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnGeneratorContext.java index fe69f35..1408049 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnGeneratorContext.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnGeneratorContext.java @@ -79,8 +79,8 @@ import static cloud.graal.gcn.GcnUtils.APP_MODULE; import static cloud.graal.gcn.GcnUtils.BOM_VERSION_SUFFIX; import static cloud.graal.gcn.GcnUtils.LIB_MODULE; -import static cloud.graal.gcn.GcnUtils.MICRONAUT_MAVEN_DEFAULT_DOCKER_IMAGE; import static cloud.graal.gcn.GcnUtils.MICRONAUT_MAVEN_PLUGIN_VERSION; +import static cloud.graal.gcn.GcnUtils.TEST_RESOURCES_VERSION; import static cloud.graal.gcn.feature.replaced.GcnJTE.JTE_GROUP_ID; import static cloud.graal.gcn.feature.replaced.GcnJTE.JTE_NATIVE_RESOURCES; import static cloud.graal.gcn.model.GcnCloud.AWS; @@ -118,14 +118,14 @@ public class GcnGeneratorContext extends GeneratorContext { private static final Map PLUGIN_GAVS = Map.ofEntries( Map.entry("com.github.johnrengelman.shadow:8.1.1", "com.github.johnrengelman:shadow:8.1.1"), - Map.entry("io.micronaut.application:4.2.1", "io.micronaut.gradle:micronaut-gradle-plugin:4.2.1"), - Map.entry("io.micronaut.library:4.2.1", "io.micronaut.gradle:micronaut-gradle-plugin:4.2.1"), - Map.entry("io.micronaut.test-resources:4.2.1", "io.micronaut.gradle:micronaut-test-resources-plugin:4.2.1"), + Map.entry("io.micronaut.application:4.3.2", "io.micronaut.gradle:micronaut-gradle-plugin:4.3.2"), + Map.entry("io.micronaut.library:4.3.2", "io.micronaut.gradle:micronaut-gradle-plugin:4.3.2"), + Map.entry("io.micronaut.test-resources:4.3.2", "io.micronaut.gradle:micronaut-test-resources-plugin:4.3.2"), Map.entry("org.jetbrains.kotlin.jvm:1.9.21", "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21"), Map.entry("org.jetbrains.kotlin.kapt:1.9.21", "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21"), Map.entry("org.jetbrains.kotlin.plugin.allopen:1.9.21", "org.jetbrains.kotlin:kotlin-allopen:1.9.21"), Map.entry("com.google.cloud.tools.jib:2.8.0", "com.google.cloud.tools.jib:com.google.cloud.tools.jib.gradle.plugin:2.8.0"), - Map.entry("io.micronaut.aot:4.2.1", "io.micronaut.gradle:micronaut-aot-plugin:4.2.1"), + Map.entry("io.micronaut.aot:4.3.2", "io.micronaut.gradle:micronaut-aot-plugin:4.3.2"), Map.entry("com.google.devtools.ksp:1.9.21-1.0.15", "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.9.21-1.0.15"), Map.entry(GG_JTE_GRADLE, "gg.jte:jte-gradle-plugin:3.0.3") ); @@ -174,8 +174,10 @@ public GcnGeneratorContext(Project project, buildProperties.put(key, GcnUtils.getMicronautVersion() + BOM_VERSION_SUFFIX); // TODO check if can be removed in new version of micronaut - buildProperties.put("micronaut.native-image.base-image-run", MICRONAUT_MAVEN_DEFAULT_DOCKER_IMAGE); - buildProperties.put("micronaut-maven-plugin.version", MICRONAUT_MAVEN_PLUGIN_VERSION); + if (!featureContext.getBuildTool().isGradle()) { + buildProperties.put("micronaut-maven-plugin.version", MICRONAUT_MAVEN_PLUGIN_VERSION); + buildProperties.put("micronaut.test.resources.version", TEST_RESOURCES_VERSION); + } } private static Map splitFeatures(Set allFeatures, diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnUtils.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnUtils.java index e1f87be..f2573f7 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnUtils.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/GcnUtils.java @@ -15,8 +15,6 @@ */ package cloud.graal.gcn; -import io.micronaut.starter.options.JdkVersion; - import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -51,14 +49,9 @@ public final class GcnUtils { public static final String MICRONAUT_MAVEN_PLUGIN_VERSION = "4.3.1"; /** - * The default docker image inside maven builds - */ - public static final String MICRONAUT_MAVEN_DEFAULT_DOCKER_IMAGE = "frolvlad/alpine-glibc:alpine-3.16"; - - /** - * The default JDK version if none is specified. + * The default version of test resources plugin */ - public static final JdkVersion DEFAULT_JDK = JDK_17; + public static final String TEST_RESOURCES_VERSION = "2.3.3"; /** * All supported JDK versions. @@ -70,28 +63,36 @@ public final class GcnUtils { */ public static final String BOM_VERSION_SUFFIX = "-oracle-00001"; - private static final String GCN_VERSION; + private static final String GCN_VERSION = loadVersion("version.txt"); + private static final String MICRONAUT_VERSION = loadVersion("micronautPlatformVersion.txt"); + + private GcnUtils() { + } - static { - URL resource = GcnUtils.class.getResource("/micronautPlatformVersion.txt"); + private static String loadVersion(String resourcePath) { + URL resource = GcnUtils.class.getResource("/" + resourcePath); if (resource == null) { - throw new IllegalStateException("Resource /micronautPlatformVersion.txt not found"); + throw new IllegalStateException("Resource /" + resourcePath + " not found"); } try (InputStream inputStream = resource.openStream()) { - GCN_VERSION = new String(inputStream.readAllBytes(), UTF_8).trim(); + return new String(inputStream.readAllBytes(), UTF_8).trim(); } catch (IOException e) { throw new RuntimeException(e); } } - private GcnUtils() { - } - /** * @return the version of Micronaut Platform */ public static String getMicronautVersion() { + return MICRONAUT_VERSION; + } + + /** + * @return the GCN version + */ + public static String getVersion() { return GCN_VERSION; } } diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/misc/template/ApacheNotice.rocker.raw b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/misc/template/ApacheNotice.rocker.raw index be30feb..0ce0090 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/misc/template/ApacheNotice.rocker.raw +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/misc/template/ApacheNotice.rocker.raw @@ -1 +1 @@ -Copyright (c) 2023, Oracle and/or its affiliates. +Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/replaced/GcnDefaultPomDependencyVersionResolver.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/replaced/GcnDefaultPomDependencyVersionResolver.java index df44d67..331a341 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/replaced/GcnDefaultPomDependencyVersionResolver.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/replaced/GcnDefaultPomDependencyVersionResolver.java @@ -33,9 +33,9 @@ @Replaces(DefaultPomDependencyVersionResolver.class) public class GcnDefaultPomDependencyVersionResolver extends DefaultPomDependencyVersionResolver { - public static final Coordinate MICRONAUT_GRADLE_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-gradle-plugin").version("4.2.1").pom(false).buildCoordinate(); - public static final Coordinate MICRONAUT_CRAC_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-crac-plugin").version("4.2.1").pom(false).buildCoordinate(); - public static final Coordinate MICRONAUT_TEST_RESOURCES_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-test-resources-plugin").version("4.2.1").pom(false).buildCoordinate(); + public static final Coordinate MICRONAUT_GRADLE_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-gradle-plugin").version("4.3.2").pom(false).buildCoordinate(); + public static final Coordinate MICRONAUT_CRAC_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-crac-plugin").version("4.3.2").pom(false).buildCoordinate(); + public static final Coordinate MICRONAUT_TEST_RESOURCES_PLUGIN = Dependency.builder().groupId("io.micronaut.gradle").artifactId("micronaut-test-resources-plugin").version("4.3.2").pom(false).buildCoordinate(); private static final Map COORDINATES; diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/streaming/AwsStreaming.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/streaming/AwsStreaming.java index d9182da..47372a0 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/streaming/AwsStreaming.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/streaming/AwsStreaming.java @@ -38,7 +38,7 @@ public class AwsStreaming extends AbstractStreamingFeature { private static final Dependency AWS_IAM_AUTH_LIB = Dependency.builder() .groupId("software.amazon.msk") .artifactId("aws-msk-iam-auth") - .version("1.1.9") + .version("2.0.3") .runtime() .build(); diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AbstractTracingFeature.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AbstractTracingFeature.java index ea21ddc..8988860 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AbstractTracingFeature.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AbstractTracingFeature.java @@ -40,6 +40,7 @@ import io.micronaut.starter.feature.opentelemetry.OpenTelemetry; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryAnnotations; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryHttp; +import io.micronaut.starter.feature.other.HttpClient; import static cloud.graal.gcn.model.GcnService.TRACING; import static io.micronaut.starter.application.ApplicationType.DEFAULT; @@ -54,6 +55,7 @@ public abstract class AbstractTracingFeature extends AbstractGcnServiceFeature { private final OpenTelemetryHttp openTelemetryHttp; private final OpenTelemetry openTelemetry; private final OpenTelemetryAnnotations openTelemetryAnnotations; + private final HttpClient httpClient; /** * @param openTelemetry OpenTelemetry feature @@ -62,10 +64,12 @@ public abstract class AbstractTracingFeature extends AbstractGcnServiceFeature { */ protected AbstractTracingFeature(OpenTelemetry openTelemetry, OpenTelemetryHttp openTelemetryHttp, - OpenTelemetryAnnotations openTelemetryAnnotations) { + OpenTelemetryAnnotations openTelemetryAnnotations, + HttpClient httpClient) { this.openTelemetry = openTelemetry; this.openTelemetryHttp = openTelemetryHttp; this.openTelemetryAnnotations = openTelemetryAnnotations; + this.httpClient = httpClient; } @Override @@ -91,6 +95,7 @@ public final void apply(GcnGeneratorContext generatorContext) { openTelemetryAnnotations.apply(generatorContext); if (generatorContext.generateExampleCode() && generatorContext.getApplicationType() == DEFAULT) { + httpClient.apply(generatorContext); generatorContext.addTemplate(getDefaultModule(), "InventoryService", generatorContext.getSourcePath("/{packagePath}/InventoryService"), diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AwsTracing.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AwsTracing.java index b3009da..d8fdd43 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AwsTracing.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/AwsTracing.java @@ -24,6 +24,7 @@ import io.micronaut.starter.feature.opentelemetry.OpenTelemetryExporterOtlp; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryHttp; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryXray; +import io.micronaut.starter.feature.other.HttpClient; import jakarta.inject.Singleton; import static cloud.graal.gcn.model.GcnCloud.AWS; @@ -50,8 +51,9 @@ public AwsTracing(OpenTelemetry openTelemetry, OpenTelemetryHttp openTelemetryHttp, OpenTelemetryAnnotations openTelemetryAnnotations, OpenTelemetryXray openTelemetryXray, - OpenTelemetryExporterOtlp openTelemetryExporterOtlp) { - super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations); + OpenTelemetryExporterOtlp openTelemetryExporterOtlp, + HttpClient httpClient) { + super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations, httpClient); this.openTelemetryXray = openTelemetryXray; this.openTelemetryExporterOtlp = openTelemetryExporterOtlp; } diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/GcpTracing.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/GcpTracing.java index 5ea7fdd..9999522 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/GcpTracing.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/GcpTracing.java @@ -24,6 +24,7 @@ import io.micronaut.starter.feature.opentelemetry.OpenTelemetryAnnotations; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryGoogleCloudTrace; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryHttp; +import io.micronaut.starter.feature.other.HttpClient; import jakarta.inject.Singleton; import static cloud.graal.gcn.model.GcnCloud.GCP; @@ -47,8 +48,9 @@ public class GcpTracing extends AbstractTracingFeature { public GcpTracing(OpenTelemetry openTelemetry, OpenTelemetryHttp openTelemetryHttp, OpenTelemetryAnnotations openTelemetryAnnotations, - OpenTelemetryGoogleCloudTrace openTelemetryGoogleCloudTrace) { - super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations); + OpenTelemetryGoogleCloudTrace openTelemetryGoogleCloudTrace, + HttpClient httpClient) { + super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations, httpClient); this.openTelemetryGoogleCloudTrace = openTelemetryGoogleCloudTrace; } diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/NonCloudTracing.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/NonCloudTracing.java index 1407b52..e254a25 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/NonCloudTracing.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/NonCloudTracing.java @@ -21,6 +21,7 @@ import io.micronaut.starter.feature.opentelemetry.OpenTelemetry; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryAnnotations; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryHttp; +import io.micronaut.starter.feature.other.HttpClient; import jakarta.inject.Singleton; import static cloud.graal.gcn.model.GcnCloud.NONE; @@ -40,8 +41,9 @@ public class NonCloudTracing extends AbstractTracingFeature { */ public NonCloudTracing(OpenTelemetry openTelemetry, OpenTelemetryHttp openTelemetryHttp, - OpenTelemetryAnnotations openTelemetryAnnotations) { - super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations); + OpenTelemetryAnnotations openTelemetryAnnotations, + HttpClient httpClient) { + super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations, httpClient); } @Override diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/OciTracing.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/OciTracing.java index 74bf032..1ef46cb 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/OciTracing.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/feature/service/tracing/OciTracing.java @@ -22,6 +22,7 @@ import io.micronaut.starter.feature.opentelemetry.OpenTelemetry; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryAnnotations; import io.micronaut.starter.feature.opentelemetry.OpenTelemetryHttp; +import io.micronaut.starter.feature.other.HttpClient; import jakarta.inject.Singleton; import static cloud.graal.gcn.model.GcnCloud.OCI; @@ -41,8 +42,9 @@ public class OciTracing extends AbstractTracingFeature { */ public OciTracing(OpenTelemetry openTelemetry, OpenTelemetryHttp openTelemetryHttp, - OpenTelemetryAnnotations openTelemetryAnnotations) { - super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations); + OpenTelemetryAnnotations openTelemetryAnnotations, + HttpClient httpClient) { + super(openTelemetry, openTelemetryHttp, openTelemetryAnnotations, httpClient); } @Override diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/BuildGradlePostProcessor.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/BuildGradlePostProcessor.java index b77c6a1..1a6a4eb 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/BuildGradlePostProcessor.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/BuildGradlePostProcessor.java @@ -53,6 +53,11 @@ public class BuildGradlePostProcessor implements TemplatePostProcessor { " images = [\"${rootProject.name}-${project.name}\"]\n" + "}\n"; + private static final String SHADOW_JAR_ZIP_64_GROOVY = + "\ntasks.named('shadowJar') {\n" + + " zip64 = true\n" + + "}\n"; + private static final String DOCKER_IMAGE_NAME_KOTLIN = "\ntasks.named(\"dockerBuild\") {\n" + " images.add(\"${rootProject.name}-${project.name}\")\n" + @@ -62,6 +67,10 @@ public class BuildGradlePostProcessor implements TemplatePostProcessor { "\ntasks.named(\"dockerBuildNative\") {\n" + " images.add(\"${rootProject.name}-${project.name}\")\n" + "}\n"; + private static final String SHADOW_JAR_ZIP_64_KOTLIN = + "\ntasks.shadowJar {\n" + + " setProperty(\"zip64\", true)\n" + + "}\n"; private static final Pattern VERSION = Pattern.compile(" version \".+\""); @@ -104,6 +113,7 @@ public String process(@NonNull String buildGradle) { } if (forCloudModule && applicationType == ApplicationType.DEFAULT && !isGatewayFunction) { buildGradle = configureDockerNativeImageName(buildGradle); + buildGradle = configureShadowJarZip64(buildGradle); } buildGradle = removePluginVersions(buildGradle); buildGradle = makeBomEnforced(buildGradle); @@ -135,6 +145,15 @@ private String configureDockerNativeImageName(@NonNull String buildGradle) { } } + @NonNull + private String configureShadowJarZip64(@NonNull String buildGradle) { + if (dsl == GROOVY) { + return buildGradle.contains(SHADOW_JAR_ZIP_64_GROOVY) ? buildGradle : buildGradle + SHADOW_JAR_ZIP_64_GROOVY; + } else { + return buildGradle.contains(SHADOW_JAR_ZIP_64_KOTLIN) ? buildGradle : buildGradle + SHADOW_JAR_ZIP_64_KOTLIN; + } + } + @NonNull private String removePluginVersions(@NonNull String buildGradle) { return VERSION.matcher(buildGradle).replaceAll(""); diff --git a/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/MavenPomPostProcessor.java b/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/MavenPomPostProcessor.java index 9c66d55..9e9c3c5 100644 --- a/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/MavenPomPostProcessor.java +++ b/gcn/gcn-core/src/main/java/cloud/graal/gcn/template/MavenPomPostProcessor.java @@ -19,17 +19,12 @@ import io.micronaut.core.annotation.NonNull; import io.micronaut.starter.application.ApplicationType; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; import java.util.Objects; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import static cloud.graal.gcn.GcnUtils.BOM_VERSION_SUFFIX; import static cloud.graal.gcn.GcnUtils.LIB_MODULE; -import static cloud.graal.gcn.GcnUtils.MICRONAUT_MAVEN_DEFAULT_DOCKER_IMAGE; /** * Fixes a few issues in Maven pom.xml files: @@ -106,7 +101,6 @@ public String process(@NonNull String pom) { if (libModule) { pom = fixArtifactId(pom); pom = fixProcessingModule(pom); - pom = fixProperties(pom); } else { if (applicationType == ApplicationType.DEFAULT && !isGatewayFunction) { pom = addDefaultDockerImageName(pom); @@ -119,21 +113,6 @@ public String process(@NonNull String pom) { return pom; } - private String fixProperties(String pom) { - Set itemsToRemove = new HashSet<>(); - itemsToRemove.add("%s".formatted(MICRONAUT_MAVEN_DEFAULT_DOCKER_IMAGE)); - List newPom = new ArrayList<>(); - String[] split = pom.split("\n"); - - for (String part: split) { - if (!itemsToRemove.contains(part.trim())) { - newPom.add(part); - } - } - - return String.join("\n", newPom) + "\n"; - } - private String fixSourceDirectory(@NonNull String pom) { if (libModule) { pom = pom.replaceFirst(" src/main/jte", " lib/src/main/jte"); diff --git a/gcn/gcn-core/src/main/resources/version.txt b/gcn/gcn-core/src/main/resources/version.txt new file mode 100644 index 0000000..8c75c4e --- /dev/null +++ b/gcn/gcn-core/src/main/resources/version.txt @@ -0,0 +1 @@ +4.2.1-2 diff --git a/gcn/gradle/wrapper/gradle-wrapper.properties b/gcn/gradle/wrapper/gradle-wrapper.properties index ac72c34..1af9e09 100644 --- a/gcn/gradle/wrapper/gradle-wrapper.properties +++ b/gcn/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gcn/version.txt b/gcn/version.txt deleted file mode 100644 index b000224..0000000 --- a/gcn/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.1-SNAPSHOT