Skip to content

Commit

Permalink
Merge branch 'quarkusio:main' into upgrade/maven_wrapper_to_version_3…
Browse files Browse the repository at this point in the history
….9.4
  • Loading branch information
bmscomp authored Oct 5, 2023
2 parents d6b4cee + a75109d commit adc72d7
Show file tree
Hide file tree
Showing 104 changed files with 2,266 additions and 216 deletions.
14 changes: 12 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<bouncycastle.tls.fips.version>1.0.16</bouncycastle.tls.fips.version>
<expressly.version>5.0.0</expressly.version>
<findbugs.version>3.0.2</findbugs.version>
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.2</parsson.version>
<parsson.version>1.1.4</parsson.version>
<resteasy-microprofile.version>2.1.4.Final</resteasy-microprofile.version>
<resteasy-spring-web.version>3.0.2.Final</resteasy-spring-web.version>
<resteasy.version>6.2.5.Final</resteasy.version>
Expand Down Expand Up @@ -878,6 +878,16 @@
<artifactId>quarkus-oidc-token-propagation-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-db-token-state-manager</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-db-token-state-manager-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-token-propagation-reactive</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<failsafe-plugin.version>${version.surefire.plugin}</failsafe-plugin.version>

<!-- Jandex versions -->
<jandex.version>3.1.3</jandex.version>
<jandex.version>3.1.5</jandex.version>
<jandex-gradle-plugin.version>1.0.0</jandex-gradle-plugin.version>

<asciidoctorj.version>2.5.10</asciidoctorj.version>
Expand Down Expand Up @@ -114,7 +114,7 @@
<wiremock-maven-plugin.version>7.3.0</wiremock-maven-plugin.version>

<!-- Artemis test dependencies -->
<artemis.version>2.30.0</artemis.version>
<artemis.version>2.31.0</artemis.version>

<!-- Code Coverage Properties-->
<jacoco.agent.argLine></jacoco.agent.argLine>
Expand Down Expand Up @@ -802,7 +802,7 @@
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.13</version>
<version>4.0.15</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,9 @@ public interface Capability {

String CACHE = QUARKUS_PREFIX + ".cache";
String JDBC_ORACLE = QUARKUS_PREFIX + ".jdbc.oracle";
String REACTIVE_PG_CLIENT = QUARKUS_PREFIX + ".reactive-pg-client";
String REACTIVE_ORACLE_CLIENT = QUARKUS_PREFIX + ".reactive-oracle-client";
String REACTIVE_MYSQL_CLIENT = QUARKUS_PREFIX + ".reactive-mysql-client";
String REACTIVE_MSSQL_CLIENT = QUARKUS_PREFIX + ".reactive-mssql-client";
String REACTIVE_DB2_CLIENT = QUARKUS_PREFIX + ".reactive-db2-client";
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -62,10 +63,16 @@ static Version parse(List<String> lines) {
String vendorVersion = secondMatcher.group(VENDOR_VERSION_GROUP);

String buildInfo = secondMatcher.group(BUILD_INFO_GROUP);
String graalVersion = graalVersion(buildInfo);
String graalVersion = graalVersion(buildInfo, v.feature());
if (vendorVersion.contains("-dev")) {
graalVersion = graalVersion + "-dev";
}
String mandrelVersion = mandrelVersion(vendorVersion);
Distribution dist = isMandrel(vendorVersion) ? Distribution.MANDREL : Distribution.ORACLE;
Distribution dist = isMandrel(vendorVersion) ? Distribution.MANDREL : Distribution.GRAALVM;
String versNum = (dist == Distribution.MANDREL ? mandrelVersion : graalVersion);
if (versNum == null) {
return UNKNOWN_VERSION;
}
return new Version(lines.stream().collect(Collectors.joining("\n")),
versNum, v.feature(), v.update(), dist);
} else {
Expand Down Expand Up @@ -100,7 +107,7 @@ private static String matchVersion(String version) {
return null;
}

private static String graalVersion(String buildInfo) {
private static String graalVersion(String buildInfo, int jdkFeature) {
if (buildInfo == null) {
return null;
}
Expand All @@ -109,10 +116,23 @@ private static String graalVersion(String buildInfo) {
return null;
}
String version = buildInfo.substring(idx + JVMCI_BUILD_PREFIX.length());
return matchVersion(version);
Matcher versMatcher = VERSION_PATTERN.matcher(version);
if (versMatcher.find()) {
return matchVersion(version);
} else {
return GRAAL_MAPPING.get(jdkFeature);
}
}
}

// Temporarily work around https://github.com/quarkusio/quarkus/issues/36246,
// till we have a consensus on how to move forward in
// https://github.com/quarkusio/quarkus/issues/34161
private static final Map<Integer, String> GRAAL_MAPPING = Map.of(22, "24.0",
23, "24.1",
24, "25.0",
25, "25.1");

public static final class Version implements Comparable<Version> {

/**
Expand All @@ -127,12 +147,12 @@ public static final class Version implements Comparable<Version> {
"(GraalVM|native-image)( Version)? " + VersionParseHelper.VERS_FORMAT + "(?<distro>.*?)?" +
"(\\(Java Version (?<jfeature>[0-9]+)(\\.(?<jinterim>[0-9]*)\\.(?<jupdate>[0-9]*))?.*)?$");

static final Version VERSION_21_3 = new Version("GraalVM 21.3", "21.3", Distribution.ORACLE);
static final Version VERSION_21_3_0 = new Version("GraalVM 21.3.0", "21.3.0", Distribution.ORACLE);
public static final Version VERSION_22_3_0 = new Version("GraalVM 22.3.0", "22.3.0", Distribution.ORACLE);
public static final Version VERSION_22_2_0 = new Version("GraalVM 22.2.0", "22.2.0", Distribution.ORACLE);
public static final Version VERSION_23_0_0 = new Version("GraalVM 23.0.0", "23.0.0", Distribution.ORACLE);
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", Distribution.ORACLE);
static final Version VERSION_21_3 = new Version("GraalVM 21.3", "21.3", Distribution.GRAALVM);
static final Version VERSION_21_3_0 = new Version("GraalVM 21.3.0", "21.3.0", Distribution.GRAALVM);
public static final Version VERSION_22_3_0 = new Version("GraalVM 22.3.0", "22.3.0", Distribution.GRAALVM);
public static final Version VERSION_22_2_0 = new Version("GraalVM 22.2.0", "22.2.0", Distribution.GRAALVM);
public static final Version VERSION_23_0_0 = new Version("GraalVM 23.0.0", "23.0.0", Distribution.GRAALVM);
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", Distribution.GRAALVM);

public static final Version MINIMUM = VERSION_22_2_0;
public static final Version CURRENT = VERSION_23_0_0;
Expand Down Expand Up @@ -226,7 +246,10 @@ public static Version of(Stream<String> output) {

if (lines.size() == 3) {
// Attempt to parse the new 3-line version scheme first.
return VersionParseHelper.parse(lines);
Version parsedVersion = VersionParseHelper.parse(lines);
if (parsedVersion != VersionParseHelper.UNKNOWN_VERSION) {
return parsedVersion;
}
} else if (lines.size() == 1) {
// Old, single line version parsing logic
final String line = lines.get(0);
Expand All @@ -249,7 +272,7 @@ public static Version of(Stream<String> output) {
version,
jFeature,
jUpdate,
isMandrel(distro) ? Distribution.MANDREL : Distribution.ORACLE);
isMandrel(distro) ? Distribution.MANDREL : Distribution.GRAALVM);
}
}

Expand Down Expand Up @@ -290,7 +313,7 @@ public boolean isJava17() {
}

enum Distribution {
ORACLE,
GRAALVM,
MANDREL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,10 @@ private RuntimeException imageGenerationFailed(int exitValue, boolean isContaine
}

private void checkGraalVMVersion(GraalVM.Version version) {
log.info("Running Quarkus native-image plugin on " + version.getFullVersion());
log.info("Running Quarkus native-image plugin on " + version.distribution.name() + " " + version.getVersionAsString()
+ " JDK " + version.javaFeatureVersion + "." + version.javaUpdateVersion);
if (version.isObsolete()) {
throw new IllegalStateException("Out of date version of GraalVM detected: " + version.getFullVersion() + "."
throw new IllegalStateException("Out of date version of GraalVM detected: " + version.getVersionAsString() + "."
+ " Quarkus currently supports " + GraalVM.Version.CURRENT.getVersionAsString()
+ ". Please upgrade GraalVM to this version.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void compress(NativeConfig nativeConfig, NativeImageRunnerBuildItem nativ
if (!runUpxFromHost(upxPathFromSystem.get(), image.getPath().toFile(), nativeConfig)) {
throw new IllegalStateException("Unable to compress the native executable");
}
} else if (nativeConfig.remoteContainerBuild()) {
log.errorf("Compression of native executables is not yet implemented for remote container builds.");
throw new IllegalStateException(
"Unable to compress the native executable: Compression of native executables is not yet supported for remote container builds");
} else if (nativeImageRunner.isContainerBuild()) {
log.infof("Running UPX from a container using the builder image: " + effectiveBuilderImage);
if (!runUpxInContainer(image, nativeConfig, effectiveBuilderImage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.ConfigClassBuildItem;
import io.quarkus.deployment.builditem.ConfigMappingBuildItem;
Expand Down Expand Up @@ -69,6 +70,7 @@
import io.quarkus.gizmo.MethodCreator;
import io.quarkus.gizmo.MethodDescriptor;
import io.quarkus.gizmo.ResultHandle;
import io.quarkus.paths.PathCollection;
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.annotations.StaticInitSafe;
import io.quarkus.runtime.configuration.ConfigBuilder;
Expand Down Expand Up @@ -267,8 +269,11 @@ void generateConfigClass(
List<RunTimeConfigBuilderBuildItem> runTimeConfigBuilders)
throws IOException {

reportUnknownBuildProperties(launchModeBuildItem.getLaunchMode(),
configItem.getReadResult().getUnknownBuildProperties());
// So it only reports during the build, because it is very likely that the property is available in runtime
// and, it will be caught by the RuntimeConfig and log double warnings
if (!launchModeBuildItem.getLaunchMode().isDevOrTest()) {
ConfigDiagnostic.unknownProperties(configItem.getReadResult().getUnknownBuildProperties());
}

if (liveReloadBuildItem.isLiveReload()) {
return;
Expand Down Expand Up @@ -320,14 +325,6 @@ void generateConfigClass(
.run();
}

private static void reportUnknownBuildProperties(LaunchMode launchMode, Set<String> unknownBuildProperties) {
// So it only reports during the build, because it is very likely that the property is available in runtime
// and, it will be caught by the RuntimeConfig and log double warnings
if (!launchMode.isDevOrTest()) {
ConfigDiagnostic.unknownProperties(unknownBuildProperties);
}
}

@BuildStep
public void suppressNonRuntimeConfigChanged(
BuildProducer<SuppressNonRuntimeConfigChangedWarningBuildItem> suppressNonRuntimeConfigChanged) {
Expand Down Expand Up @@ -441,6 +438,31 @@ public void watchConfigFiles(BuildProducer<HotDeploymentWatchedFileBuildItem> wa
}
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void unknownConfigFiles(
ApplicationArchivesBuildItem applicationArchives,
LaunchModeBuildItem launchModeBuildItem,
ConfigRecorder configRecorder) throws Exception {

PathCollection rootDirectories = applicationArchives.getRootArchive().getRootDirectories();
if (!rootDirectories.isSinglePath()) {
return;
}

Set<String> buildTimeFiles = new HashSet<>();
buildTimeFiles.addAll(ConfigDiagnostic.configFiles(rootDirectories.getSinglePath()));
buildTimeFiles.addAll(ConfigDiagnostic.configFilesFromLocations());

// Report always at build time since config folder and locations may differ from build to runtime
ConfigDiagnostic.unknownConfigFiles(buildTimeFiles);

// No need to include the application files, because they don't change
if (!launchModeBuildItem.getLaunchMode().isDevOrTest()) {
configRecorder.unknownConfigFiles();
}
}

@BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
@Record(ExecutionTime.RUNTIME_INIT)
void warnDifferentProfileUsedBetweenBuildAndRunTime(ConfigRecorder configRecorder) {
Expand Down
Loading

0 comments on commit adc72d7

Please sign in to comment.