diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 05aa5e4f7f7b6..2ac56397ec608 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -81,15 +81,15 @@ 22.1.0 22.0.0.2 - 1.0.10.Final + 1.0.11.Final 2.13.2.20220328 1.0.0.Final 3.12.0 1.15 1.5.1 - 5.6.8.Final + 5.6.9.Final 1.12.9 - 1.1.4.Final + 1.1.5.Beta2 6.2.3.Final 6.1.3.Final 5.12.6.Final @@ -147,7 +147,7 @@ 1.4.2 1.6.21 1.6.1 - 1.3.2 + 1.3.3 5.12.2 2.9.2 3.1.0 diff --git a/devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java b/devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java index 7add0bae4e14b..7752084a678d3 100644 --- a/devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java +++ b/devtools/gradle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/QuarkusExtensionPlugin.java @@ -143,7 +143,7 @@ private Project findDeploymentProject(Project project, QuarkusExtensionConfigura } if (deploymentProject == null) { project.getLogger().warn("Unable to find deployment project with name: " + deploymentProjectName - + ". You can configure the deployment project name by setting the 'deploymentArtifact' property in the plugin extension."); + + ". You can configure the deployment project name by setting the 'deploymentModule' property in the plugin extension."); } } return deploymentProject; diff --git a/docs/src/main/asciidoc/container-image.adoc b/docs/src/main/asciidoc/container-image.adoc index 6b8b855cd9d69..e7669cc03b207 100644 --- a/docs/src/main/asciidoc/container-image.adoc +++ b/docs/src/main/asciidoc/container-image.adoc @@ -68,6 +68,10 @@ To use this feature, add the following extension to your project. :add-extension-extensions: container-image-docker include::includes/devtools/extension-add.adoc[] +The `quarkus-container-image-docker` extension is capable of https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images/[creating multi-platform (or multi-arch)] images using https://docs.docker.com/engine/reference/commandline/buildx_build/[`docker buildx build`]. See the `quarkus.docker.platform` configuration item in the <<#DockerOptions,Docker Options>> section below. + +NOTE: `docker buildx build` ONLY supports https://docs.docker.com/engine/reference/commandline/buildx_build/#load[loading the result of a build] to `docker images` when building for a single platform. Therefore, if you specify more than one argument in the `quarkus.docker.platform` property, the resulting images will not be loaded into `docker images`. If `quarkus.docker.platform` is omitted or if only a single platform is specified, it will then be loaded into `docker images`. + [#s2i] === S2I @@ -190,6 +194,7 @@ In addition to the generic container image options, the `container-image-jib` al include::{generated-dir}/config/quarkus-container-image-jib.adoc[opts=optional, leveloffset=+1] +[#DockerOptions] === Docker Options In addition to the generic container image options, the `container-image-docker` also provides the following options: diff --git a/docs/src/main/asciidoc/writing-extensions.adoc b/docs/src/main/asciidoc/writing-extensions.adoc index be0a749fd142f..6cedd9ceb5d75 100644 --- a/docs/src/main/asciidoc/writing-extensions.adoc +++ b/docs/src/main/asciidoc/writing-extensions.adoc @@ -546,7 +546,7 @@ Please refer to https://github.com/quarkusio/quarkus/blob/{quarkus-version}/devt You will need to apply the `io.quarkus.extension` plugin in the `runtime` module of your extension project. The plugin includes the `extensionDescriptor` task that will generate `META-INF/quarkus-extension.properties` and `META-INF/quarkus-extension.yml` files. The plugin also enables the `io.quarkus:quarkus-extension-processor` annotation processor in both `deployment` and `runtime` modules. -The name of the deployment module can be configured in the plugin by setting the `deploymentArtifact` property. The property is set to `deployment` by default: +The name of the deployment module can be configured in the plugin by setting the `deploymentModule` property. The property is set to `deployment` by default: [source,groovy,subs=attributes+] ---- @@ -556,7 +556,7 @@ plugins { } quarkusExtension { - deploymentArtifact = 'deployment' + deploymentModule = 'deployment' } dependencies { diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java index 86cd209ca2480..89b53bebad504 100644 --- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java +++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java @@ -4,6 +4,8 @@ import java.util.Map; import java.util.Optional; +import io.quarkus.runtime.annotations.ConfigDocSection; +import io.quarkus.runtime.annotations.ConfigGroup; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @@ -51,4 +53,50 @@ public class DockerConfig { */ @ConfigItem(defaultValue = "docker") public String executableName; + + /** + * Configuration for Docker Buildx options + */ + @ConfigItem + @ConfigDocSection + public DockerBuildxConfig buildx; + + /** + * Configuration for Docker Buildx options. These are only relevant if using Docker Buildx + * (https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images) to build multi-platform (or + * cross-platform) + * images. + * If any of these configurations are set, it will add {@code buildx} to the {@code executableName}. + */ + @ConfigGroup + public static class DockerBuildxConfig { + /** + * Which platform(s) to target during the build. See + * https://docs.docker.com/engine/reference/commandline/buildx_build/#platform + */ + @ConfigItem + public Optional> platform; + + /** + * Sets the export action for the build result. See + * https://docs.docker.com/engine/reference/commandline/buildx_build/#output. Note that any filesystem paths need to be + * absolute paths, + * not relative from where the command is executed from. + */ + @ConfigItem + public Optional output; + + /** + * Set type of progress output ({@code auto}, {@code plain}, {@code tty}). Use {@code plain} to show container output + * (default “{@code auto}”). See https://docs.docker.com/engine/reference/commandline/buildx_build/#progress + */ + @ConfigItem + public Optional progress; + + boolean useBuildx() { + return platform.filter(p -> !p.isEmpty()).isPresent() || + output.isPresent() || + progress.isPresent(); + } + } } diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java index d4552db4ddf1c..91ddf4e94cce8 100644 --- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java +++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java @@ -20,6 +20,7 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; +import java.util.stream.Stream; import org.jboss.logging.Logger; @@ -162,71 +163,130 @@ private String createContainerImage(ContainerImageConfig containerImageConfig, D OutputTargetBuildItem out, ImageIdReader reader, boolean forNative, boolean pushRequested, PackageConfig packageConfig) { + var useBuildx = dockerConfig.buildx.useBuildx(); + var pushImages = pushRequested || containerImageConfig.isPushExplicitlyEnabled(); + DockerfilePaths dockerfilePaths = getDockerfilePaths(dockerConfig, forNative, packageConfig, out); - String[] dockerArgs = getDockerArgs(containerImageInfo.getImage(), dockerfilePaths, containerImageConfig, dockerConfig); + String[] dockerArgs = getDockerArgs(containerImageInfo.getImage(), dockerfilePaths, containerImageConfig, dockerConfig, + containerImageInfo, pushImages); + + if (useBuildx && pushImages) { + // Needed because buildx will push all the images in a single step + loginToRegistryIfNeeded(containerImageConfig, containerImageInfo, dockerConfig); + } + log.infof("Executing the following command to build docker image: '%s %s'", dockerConfig.executableName, String.join(" ", dockerArgs)); + boolean buildSuccessful = ExecUtil.exec(out.getOutputDirectory().toFile(), reader, dockerConfig.executableName, dockerArgs); if (!buildSuccessful) { throw dockerException(dockerArgs); } - log.infof("Built container image %s (%s)\n", containerImageInfo.getImage(), reader.getImageId()); - - if (!containerImageInfo.getAdditionalImageTags().isEmpty()) { - createAdditionalTags(containerImageInfo.getImage(), containerImageInfo.getAdditionalImageTags(), dockerConfig); - } - - if (pushRequested || containerImageConfig.isPushExplicitlyEnabled()) { - String registry = "docker.io"; - if (!containerImageInfo.getRegistry().isPresent()) { - log.info("No container image registry was set, so 'docker.io' will be used"); - } else { - registry = containerImageInfo.getRegistry().get(); - } - // Check if we need to login first - if (containerImageConfig.username.isPresent() && containerImageConfig.password.isPresent()) { - boolean loginSuccessful = ExecUtil.exec(dockerConfig.executableName, "login", registry, "-u", - containerImageConfig.username.get(), - "-p" + containerImageConfig.password.get()); - if (!loginSuccessful) { - throw dockerException(new String[] { "-u", containerImageConfig.username.get(), "-p", "********" }); - } + dockerConfig.buildx.platform + .filter(platform -> platform.size() > 1) + .ifPresentOrElse( + platform -> log.infof("Built container image %s (%s platform(s))\n", containerImageInfo.getImage(), + String.join(",", platform)), + () -> log.infof("Built container image %s (%s)\n", containerImageInfo.getImage(), reader.getImageId())); + + if (!useBuildx) { + // If we didn't use buildx, now we need to process any tags + if (!containerImageInfo.getAdditionalImageTags().isEmpty()) { + createAdditionalTags(containerImageInfo.getImage(), containerImageInfo.getAdditionalImageTags(), dockerConfig); } - List imagesToPush = new ArrayList<>(containerImageInfo.getAdditionalImageTags()); - imagesToPush.add(containerImageInfo.getImage()); - for (String imageToPush : imagesToPush) { - pushImage(imageToPush, dockerConfig); + if (pushImages) { + // If not using buildx, push the images + loginToRegistryIfNeeded(containerImageConfig, containerImageInfo, dockerConfig); + + Stream.concat(containerImageInfo.getAdditionalTags().stream(), Stream.of(containerImageInfo.getImage())) + .forEach(imageToPush -> pushImage(imageToPush, dockerConfig)); } } return containerImageInfo.getImage(); } + private void loginToRegistryIfNeeded(ContainerImageConfig containerImageConfig, + ContainerImageInfoBuildItem containerImageInfo, DockerConfig dockerConfig) { + var registry = containerImageInfo.getRegistry() + .orElseGet(() -> { + log.info("No container image registry was set, so 'docker.io' will be used"); + return "docker.io"; + }); + + // Check if we need to login first + if (containerImageConfig.username.isPresent() && containerImageConfig.password.isPresent()) { + boolean loginSuccessful = ExecUtil.exec(dockerConfig.executableName, "login", registry, "-u", + containerImageConfig.username.get(), + "-p" + containerImageConfig.password.get()); + if (!loginSuccessful) { + throw dockerException(new String[] { "-u", containerImageConfig.username.get(), "-p", "********" }); + } + } + } + private String[] getDockerArgs(String image, DockerfilePaths dockerfilePaths, ContainerImageConfig containerImageConfig, - DockerConfig dockerConfig) { + DockerConfig dockerConfig, ContainerImageInfoBuildItem containerImageInfo, boolean pushImages) { List dockerArgs = new ArrayList<>(6 + dockerConfig.buildArgs.size()); - dockerArgs.addAll(Arrays.asList("build", "-f", dockerfilePaths.getDockerfilePath().toAbsolutePath().toString())); - for (Map.Entry entry : dockerConfig.buildArgs.entrySet()) { - dockerArgs.addAll(Arrays.asList("--build-arg", entry.getKey() + "=" + entry.getValue())); - } - for (Map.Entry entry : containerImageConfig.labels.entrySet()) { - dockerArgs.addAll(Arrays.asList("--label", String.format("%s=%s", entry.getKey(), entry.getValue()))); - } - if (dockerConfig.cacheFrom.isPresent()) { - List cacheFrom = dockerConfig.cacheFrom.get(); - if (!cacheFrom.isEmpty()) { - dockerArgs.add("--cache-from"); - dockerArgs.add(String.join(",", cacheFrom)); + var useBuildx = dockerConfig.buildx.useBuildx(); + + if (useBuildx) { + // Check the executable. If not 'docker', then fail the build + if (!DOCKER.equals(dockerConfig.executableName)) { + throw new IllegalArgumentException( + String.format( + "The 'buildx' properties are specific to 'executable-name=docker' and can not be used with the '%s' executable name. Either remove the `buildx` properties or the `executable-name` property.", + dockerConfig.executableName)); } + + dockerArgs.add("buildx"); } - if (dockerConfig.network.isPresent()) { + + dockerArgs.addAll(Arrays.asList("build", "-f", dockerfilePaths.getDockerfilePath().toAbsolutePath().toString())); + dockerConfig.buildx.platform + .filter(platform -> !platform.isEmpty()) + .ifPresent(platform -> { + dockerArgs.add("--platform"); + dockerArgs.add(String.join(",", platform)); + + if (platform.size() == 1) { + // Buildx only supports loading the image to the docker system if there is only 1 image + dockerArgs.add("--load"); + } + }); + dockerConfig.buildx.progress.ifPresent(progress -> dockerArgs.addAll(List.of("--progress", progress))); + dockerConfig.buildx.output.ifPresent(output -> dockerArgs.addAll(List.of("--output", output))); + dockerConfig.buildArgs + .forEach((key, value) -> dockerArgs.addAll(Arrays.asList("--build-arg", String.format("%s=%s", key, value)))); + containerImageConfig.labels + .forEach((key, value) -> dockerArgs.addAll(Arrays.asList("--label", String.format("%s=%s", key, value)))); + dockerConfig.cacheFrom + .filter(cacheFrom -> !cacheFrom.isEmpty()) + .ifPresent(cacheFrom -> { + dockerArgs.add("--cache-from"); + dockerArgs.add(String.join(",", cacheFrom)); + }); + dockerConfig.network.ifPresent(network -> { dockerArgs.add("--network"); - dockerArgs.add(dockerConfig.network.get()); - } + dockerArgs.add(network); + }); dockerArgs.addAll(Arrays.asList("-t", image)); + + if (useBuildx) { + // When using buildx for multi-arch images, it wants to push in a single step + // 1) Create all the additional tags + containerImageInfo.getAdditionalImageTags() + .forEach(additionalImageTag -> dockerArgs.addAll(List.of("-t", additionalImageTag))); + + if (pushImages) { + // 2) Enable the --push flag + dockerArgs.add("--push"); + } + } + dockerArgs.add(dockerfilePaths.getDockerExecutionPath().toAbsolutePath().toString()); return dockerArgs.toArray(new String[0]); } diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java index 8fa4d92a6b1be..c0a0dd6b8d8e2 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java @@ -1160,60 +1160,63 @@ public void handle(Void event) { } }); } - httpServer.listen(options.getPort(), options.getHost(), event -> { - if (event.cause() != null) { - startFuture.fail(event.cause()); - } else { - // Port may be random, so set the actual port - int actualPort = event.result().actualPort(); - - if (https) { - actualHttpsPort = actualPort; + httpServer.listen(options.getPort(), options.getHost(), new Handler<>() { + @Override + public void handle(AsyncResult event) { + if (event.cause() != null) { + startFuture.fail(event.cause()); } else { - actualHttpPort = actualPort; - } - if (remainingCount.decrementAndGet() == 0) { - //make sure we only set the properties once - if (actualPort != options.getPort()) { - // Override quarkus.http(s)?.(test-)?port - String schema; - if (https) { - clearHttpsProperty = true; - schema = "https"; - } else { - clearHttpProperty = true; - actualHttpPort = actualPort; - schema = "http"; - } - portPropertiesToRestore = new HashMap<>(); - String portPropertyValue = String.valueOf(actualPort); - //we always set the .port property, even if we are in test mode, so this will always - //reflect the current port - String portPropertyName = "quarkus." + schema + ".port"; - String prevPortPropertyValue = System.setProperty(portPropertyName, portPropertyValue); - if (!Objects.equals(prevPortPropertyValue, portPropertyValue)) { - portPropertiesToRestore.put(portPropertyName, prevPortPropertyValue); - } - if (launchMode == LaunchMode.TEST) { - //we also set the test-port property in a test - String testPropName = "quarkus." + schema + ".test-port"; - String prevTestPropPrevValue = System.setProperty(testPropName, portPropertyValue); - if (!Objects.equals(prevTestPropPrevValue, portPropertyValue)) { - portPropertiesToRestore.put(testPropName, prevTestPropPrevValue); + // Port may be random, so set the actual port + int actualPort = event.result().actualPort(); + + if (https) { + actualHttpsPort = actualPort; + } else { + actualHttpPort = actualPort; + } + if (remainingCount.decrementAndGet() == 0) { + //make sure we only set the properties once + if (actualPort != options.getPort()) { + // Override quarkus.http(s)?.(test-)?port + String schema; + if (https) { + clearHttpsProperty = true; + schema = "https"; + } else { + clearHttpProperty = true; + actualHttpPort = actualPort; + schema = "http"; } - } - if (launchMode.isDevOrTest()) { - // set the profile property as well to make sure we don't have any inconsistencies - portPropertyName = propertyWithProfilePrefix(portPropertyName); - prevPortPropertyValue = System.setProperty(portPropertyName, portPropertyValue); + portPropertiesToRestore = new HashMap<>(); + String portPropertyValue = String.valueOf(actualPort); + //we always set the .port property, even if we are in test mode, so this will always + //reflect the current port + String portPropertyName = "quarkus." + schema + ".port"; + String prevPortPropertyValue = System.setProperty(portPropertyName, portPropertyValue); if (!Objects.equals(prevPortPropertyValue, portPropertyValue)) { portPropertiesToRestore.put(portPropertyName, prevPortPropertyValue); } + if (launchMode == LaunchMode.TEST) { + //we also set the test-port property in a test + String testPropName = "quarkus." + schema + ".test-port"; + String prevTestPropPrevValue = System.setProperty(testPropName, portPropertyValue); + if (!Objects.equals(prevTestPropPrevValue, portPropertyValue)) { + portPropertiesToRestore.put(testPropName, prevTestPropPrevValue); + } + } + if (launchMode.isDevOrTest()) { + // set the profile property as well to make sure we don't have any inconsistencies + portPropertyName = propertyWithProfilePrefix(portPropertyName); + prevPortPropertyValue = System.setProperty(portPropertyName, portPropertyValue); + if (!Objects.equals(prevPortPropertyValue, portPropertyValue)) { + portPropertiesToRestore.put(portPropertyName, prevPortPropertyValue); + } + } } + startFuture.complete(null); } - startFuture.complete(null); - } + } } }); } diff --git a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java index 64c87794043ec..5f7dab2f77732 100644 --- a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java +++ b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java @@ -421,7 +421,9 @@ private static void initializeClusterOptions(VertxConfiguration conf, VertxOptio if (cluster.port.isPresent()) { options.getEventBusOptions().setPort(cluster.port.getAsInt()); } - cluster.publicHost.ifPresent(options.getEventBusOptions()::setClusterPublicHost); + if (cluster.publicHost.isPresent()) { + options.getEventBusOptions().setClusterPublicHost(cluster.publicHost.get()); + } if (cluster.publicPort.isPresent()) { options.getEventBusOptions().setPort(cluster.publicPort.getAsInt()); } diff --git a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/context/VertxContextSafetyToggle.java b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/context/VertxContextSafetyToggle.java index 0826786c47be9..178d075f1f9dc 100644 --- a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/context/VertxContextSafetyToggle.java +++ b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/context/VertxContextSafetyToggle.java @@ -41,7 +41,14 @@ public final class VertxContextSafetyToggle { private static final Object ACCESS_TOGGLE_KEY = new Object(); public static final String UNRESTRICTED_BY_DEFAULT_PROPERTY = "io.quarkus.vertx.core.runtime.context.VertxContextSafetyToggle.UNRESTRICTED_BY_DEFAULT"; + + /** + * This gets exposed for people who prefer fully disabling all safeguards, for example because they have tested it all + * carefully under load already and are preferring maximum efficiency over the safeguards introduced by this class. + */ + public static final String FULLY_DISABLE_PROPERTY = "io.quarkus.vertx.core.runtime.context.VertxContextSafetyToggle.I_HAVE_CHECKED_EVERYTHING"; private static final boolean UNRESTRICTED_BY_DEFAULT = Boolean.getBoolean(UNRESTRICTED_BY_DEFAULT_PROPERTY); + private static final boolean FULLY_DISABLED = Boolean.getBoolean(FULLY_DISABLE_PROPERTY); /** * Verifies if the current Vert.x context was flagged as safe @@ -58,6 +65,8 @@ public final class VertxContextSafetyToggle { * @throws IllegalStateException if the context exists and it failed to be validated */ public static void validateContextIfExists(final String errorMessageOnVeto, final String errorMessageOnDoubt) { + if (FULLY_DISABLED) + return; final io.vertx.core.Context context = Vertx.currentContext(); if (context != null) { checkIsSafe(context, errorMessageOnVeto, errorMessageOnDoubt); @@ -90,6 +99,8 @@ private static void checkIsSafe(final Context context, final String errorMessage * @throws IllegalStateException if there is no current context, or if it's of the wrong type. */ public static void setCurrentContextSafe(final boolean safe) { + if (FULLY_DISABLED) + return; final io.vertx.core.Context context = Vertx.currentContext(); setContextSafe(context, safe); } @@ -101,6 +112,8 @@ public static void setCurrentContextSafe(final boolean safe) { * @throws IllegalStateException if context is null or not of the expected type. */ public static void setContextSafe(final Context context, final boolean safe) { + if (FULLY_DISABLED) + return; if (context == null) { throw new IllegalStateException("Can't set the context safety flag: no Vert.x context found"); } else if (!VertxContext.isDuplicatedContext(context)) { diff --git a/independent-projects/arc/pom.xml b/independent-projects/arc/pom.xml index 8269a9ed7663c..a7e28cd90648b 100644 --- a/independent-projects/arc/pom.xml +++ b/independent-projects/arc/pom.xml @@ -48,7 +48,7 @@ 3.22.0 3.5.0.Final 1.3.5 - 1.0.10.Final + 1.0.11.Final 2.2.3 3.0.0-M5 diff --git a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Instances.java b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Instances.java index 047da5923fac4..6e75c4e3ed288 100644 --- a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Instances.java +++ b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Instances.java @@ -11,9 +11,7 @@ import java.util.Comparator; import java.util.List; import java.util.Set; -import java.util.function.Predicate; import java.util.function.Supplier; -import java.util.stream.Collectors; import javax.enterprise.context.Dependent; import javax.enterprise.inject.spi.InjectionPoint; @@ -21,8 +19,12 @@ public final class Instances { static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[] {}; - static final Comparator> PRIORITY_COMPARATOR = Collections - .reverseOrder(Comparator.comparingInt(InjectableBean::getPriority)); + static final Comparator> PRIORITY_COMPARATOR = new Comparator<>() { + @Override + public int compare(InjectableBean ib1, InjectableBean ib2) { + return Integer.compare(ib2.getPriority(), ib1.getPriority()); + } + }; private Instances() { } @@ -32,12 +34,16 @@ public static List> resolveBeans(Type requiredType, Set> resolveBeans(Type requiredType, Annotation... requiredQualifiers) { - return ArcContainerImpl.instance() - .getResolvedBeans(requiredType, requiredQualifiers) - .stream() - .filter(Predicate.not(InjectableBean::isSuppressed)) - .sorted(PRIORITY_COMPARATOR) - .collect(Collectors.toUnmodifiableList()); + Set> resolvedBeans = ArcContainerImpl.instance() + .getResolvedBeans(requiredType, requiredQualifiers); + List> nonSuppressed = new ArrayList<>(resolvedBeans.size()); + for (InjectableBean injectableBean : resolvedBeans) { + if (!injectableBean.isSuppressed()) { + nonSuppressed.add(injectableBean); + } + } + nonSuppressed.sort(PRIORITY_COMPARATOR); + return List.copyOf(nonSuppressed); } @SuppressWarnings("unchecked") diff --git a/independent-projects/qute/pom.xml b/independent-projects/qute/pom.xml index 7e70e6650e4cc..d6917d25cf73a 100644 --- a/independent-projects/qute/pom.xml +++ b/independent-projects/qute/pom.xml @@ -42,7 +42,7 @@ 11 5.8.2 3.22.0 - 1.0.10.Final + 1.0.11.Final 3.5.0.Final 3.0.0-M5 1.6.8 diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml index d78bc63f4b4f4..570ef63de9e6e 100644 --- a/independent-projects/resteasy-reactive/pom.xml +++ b/independent-projects/resteasy-reactive/pom.xml @@ -47,7 +47,7 @@ 3.22.0 3.5.0.Final 1.3.5 - 1.0.10.Final + 1.0.11.Final 2.2.3 3.0.0-M5 diff --git a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java index 95fc3a36f9420..30ded9ecf025e 100644 --- a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java +++ b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java @@ -328,7 +328,7 @@ public ServerHttpResponse setStatusCode(int code) { @Override public ServerHttpResponse end() { if (!response.ended()) { - response.end(); + response.end((Handler>) null); } return this; } @@ -340,13 +340,13 @@ public boolean headWritten() { @Override public ServerHttpResponse end(byte[] data) { - response.end(Buffer.buffer(data)); + response.end(Buffer.buffer(data), null); return this; } @Override public ServerHttpResponse end(String data) { - response.end(data); + response.end(Buffer.buffer(data), null); return this; } diff --git a/jakarta/rewrite.yml b/jakarta/rewrite.yml index e82909d597836..732d8bf0f5d9d 100644 --- a/jakarta/rewrite.yml +++ b/jakarta/rewrite.yml @@ -61,9 +61,6 @@ recipeList: - org.openrewrite.maven.ChangePropertyValue: key: jakarta.persistence-api.version newValue: 3.0.0 - - org.openrewrite.maven.ChangePropertyValue: - key: hibernate-reactive.version - newValue: 1.1.5.Beta1 - org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId: oldGroupId: org.hibernate oldArtifactId: hibernate-core