Skip to content

Commit

Permalink
Merge pull request #28396 from gsmet/2.13.2-backports-1
Browse files Browse the repository at this point in the history
2.13.2 backports 1
  • Loading branch information
gsmet committed Oct 12, 2022
2 parents 79cf3da + 3aaf91e commit 3d61bd5
Show file tree
Hide file tree
Showing 73 changed files with 736 additions and 162 deletions.
10 changes: 5 additions & 5 deletions bom/application/pom.xml
Expand Up @@ -97,7 +97,7 @@
<jboss-transaction-api_1.2_spec.version>1.1.1.Final</jboss-transaction-api_1.2_spec.version>
<agroal.version>1.16</agroal.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
<elasticsearch-opensource-components.version>8.4.1</elasticsearch-opensource-components.version>
<elasticsearch-opensource-components.version>8.4.3</elasticsearch-opensource-components.version>
<!-- for the now proprietary components of Elasticsearch, we use the last Open Source version -->
<elasticsearch-proprietary-components-keeping-old-opensource-version.version>7.10.2</elasticsearch-proprietary-components-keeping-old-opensource-version.version>
<rxjava.version>2.2.21</rxjava.version>
Expand Down Expand Up @@ -133,8 +133,8 @@
<infinispan.version>13.0.11.Final</infinispan.version>
<infinispan.protostream.version>4.4.3.Final</infinispan.protostream.version>
<caffeine.version>2.9.3</caffeine.version>
<netty.version>4.1.79.Final</netty.version>
<brotli4j.version>1.7.1</brotli4j.version>
<netty.version>4.1.82.Final</netty.version>
<brotli4j.version>1.8.0</brotli4j.version>
<reactive-streams.version>1.0.3</reactive-streams.version>
<jboss-logging.version>3.5.0.Final</jboss-logging.version>
<mutiny.version>1.7.0</mutiny.version>
Expand All @@ -143,7 +143,7 @@
<snappy.version>1.1.8.4</snappy.version>
<strimzi-test-container.version>0.100.0</strimzi-test-container.version>
<!-- Scala is used by Kafka so we need to choose a compatible version -->
<scala.version>2.13.8</scala.version>
<scala.version>2.13.10</scala.version>
<aws-lambda-java.version>1.2.1</aws-lambda-java.version>
<aws-lambda-java-events.version>3.11.0</aws-lambda-java-events.version>
<aws-xray.version>2.11.2</aws-xray.version>
Expand All @@ -161,7 +161,7 @@
<liquibase.version>4.16.1</liquibase.version>
<snakeyaml.version>1.33</snakeyaml.version>
<osgi.version>6.0.0</osgi.version>
<mongo-client.version>4.7.1</mongo-client.version>
<mongo-client.version>4.7.2</mongo-client.version>
<mongo-crypt.version>1.5.2</mongo-crypt.version>
<proton-j.version>0.34.0</proton-j.version>
<javaparser.version>3.24.2</javaparser.version>
Expand Down
Expand Up @@ -5,6 +5,7 @@
import static io.quarkus.dev.console.QuarkusConsole.IS_WINDOWS;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.deployment.pkg.NativeConfig;

/**
* Native-image might not be supported for a particular
Expand All @@ -30,4 +31,15 @@ public UnsupportedOSBuildItem(Os os, String error) {
this.os = os;
this.error = error;
}

public boolean triggerError(NativeConfig nativeConfig) {
return
// When the host OS is unsupported, it could have helped to
// run in a Linux builder image (e.g. an extension unsupported on Windows).
(os.active && !nativeConfig.isContainerBuild()) ||
// If Linux is the OS the extension does not support,
// it fails in a container build regardless the host OS,
// because we have only Linux based builder images.
(nativeConfig.isContainerBuild() && os == Os.LINUX);
}
}
Expand Up @@ -419,7 +419,6 @@ protected void prepare() throws Exception {
devModeContext.setReleaseJavaVersion(releaseJavaVersion);
devModeContext.setSourceJavaVersion(sourceJavaVersion);
devModeContext.setTargetJvmVersion(targetJavaVersion);

devModeContext.getLocalArtifacts().addAll(localArtifacts);
devModeContext.setApplicationRoot(main);
devModeContext.getAdditionalModules().addAll(dependencies);
Expand Down
Expand Up @@ -877,7 +877,9 @@ public NativeImageInvokerInfo build() {
}

if (unsupportedOSes != null && !unsupportedOSes.isEmpty()) {
final String errs = unsupportedOSes.stream().filter(o -> o.os.active).map(o -> o.error)
final String errs = unsupportedOSes.stream()
.filter(o -> o.triggerError(nativeConfig))
.map(o -> o.error)
.collect(Collectors.joining(", "));
if (!errs.isEmpty()) {
throw new UnsupportedOperationException(errs);
Expand Down
13 changes: 13 additions & 0 deletions devtools/bom-descriptor-json/pom.xml
Expand Up @@ -2189,6 +2189,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-kotlin-serialization-common</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-links</artifactId>
Expand Down
29 changes: 19 additions & 10 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Expand Up @@ -43,6 +43,7 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.BuildBase;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.Profile;
Expand Down Expand Up @@ -90,6 +91,8 @@
import io.quarkus.bootstrap.model.ApplicationModel;
import io.quarkus.bootstrap.model.PathsCollection;
import io.quarkus.bootstrap.resolver.BootstrapAppModelResolver;
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext;
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContextConfig;
import io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver;
import io.quarkus.bootstrap.resolver.maven.options.BootstrapMavenOptions;
import io.quarkus.bootstrap.util.BootstrapUtils;
Expand Down Expand Up @@ -741,7 +744,6 @@ private String getSourceEncoding() {
}

private void addProject(MavenDevModeLauncher.Builder builder, ResolvedDependency module, boolean root) throws Exception {

if (!module.isJar()) {
return;
}
Expand Down Expand Up @@ -1060,30 +1062,37 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
if (appModel != null) {
bootstrapProvider.close();
} else {
final MavenArtifactResolver.Builder resolverBuilder = MavenArtifactResolver.builder()
final BootstrapMavenContextConfig<?> mvnConfig = BootstrapMavenContext.config()
.setRemoteRepositories(repos)
.setRemoteRepositoryManager(remoteRepositoryManager)
.setWorkspaceDiscovery(true)
.setPreferPomsFromWorkspace(true)
.setCurrentProject(project.getFile().toString());

// if it already exists, it may be a reload triggered by a change in a POM
// in which case we should not be using the original Maven session
boolean reinitializeMavenSession = Files.exists(appModelLocation);
if (reinitializeMavenSession) {
// if a serialized model is found, it may be a reload triggered by a change in a POM
// in which case we should not be using the original Maven session initialized with the previous POM version
if (Files.exists(appModelLocation)) {
Files.delete(appModelLocation);
// we can't re-use the repo system because we want to use our interpolating model builder
// a use-case where it fails with the original repo system is when dev mode is launched with -Dquarkus.platform.version=xxx
// overriding the version of the quarkus-bom in the pom.xml
} else {
// we can re-use the original Maven session
resolverBuilder.setRepositorySystemSession(repoSession).setRepositorySystem(repoSystem);
// we can re-use the original Maven session and the system
mvnConfig.setRepositorySystemSession(repoSession).setRepositorySystem(repoSystem);
// there could be Maven extensions manipulating the project versions and models
// the ones returned from the Maven API could be different from the original pom.xml files
final Map<Path, Model> projectModels = new HashMap<>(session.getAllProjects().size());
for (MavenProject mp : session.getAllProjects()) {
projectModels.put(mp.getBasedir().toPath(), mp.getOriginalModel());
}
mvnConfig.setProjectModelProvider(projectModels::get);
}

appModel = new BootstrapAppModelResolver(resolverBuilder.build())
final BootstrapMavenContext mvnCtx = new BootstrapMavenContext(mvnConfig);
appModel = new BootstrapAppModelResolver(new MavenArtifactResolver(mvnCtx))
.setDevMode(true)
.setCollectReloadableDependencies(!noDeps)
.resolveModel(ArtifactCoords.jar(project.getGroupId(), project.getArtifactId(), project.getVersion()));
.resolveModel(mvnCtx.getCurrentProject().getAppArtifact());
}

// serialize the app model to avoid re-resolving it in the dev process
Expand Down
Expand Up @@ -6,6 +6,8 @@
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -14,6 +16,7 @@
import java.util.concurrent.ExecutionException;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.component.annotations.Component;
Expand Down Expand Up @@ -132,16 +135,21 @@ private MavenArtifactResolver artifactResolver(QuarkusBootstrapMojo mojo, Launch
throws MojoExecutionException {
isWorkspaceDiscovery(mojo);
try {
return MavenArtifactResolver.builder()
.setWorkspaceDiscovery(
mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST || isWorkspaceDiscovery(mojo))
final MavenArtifactResolver.Builder builder = MavenArtifactResolver.builder()
.setCurrentProject(mojo.mavenProject().getFile().toString())
.setPreferPomsFromWorkspace(mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST)
.setRepositorySystem(repoSystem)
.setRepositorySystemSession(mojo.repositorySystemSession())
.setRemoteRepositories(mojo.remoteRepositories())
.setRemoteRepositoryManager(remoteRepoManager)
.build();
.setRemoteRepositoryManager(remoteRepoManager);
if (mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST || isWorkspaceDiscovery(mojo)) {
final Map<Path, Model> projectModels = new HashMap<>(mojo.mavenSession().getAllProjects().size());
for (MavenProject mp : mojo.mavenSession().getAllProjects()) {
projectModels.put(mp.getBasedir().toPath(), mp.getOriginalModel());
}
builder.setWorkspaceDiscovery(true).setProjectModelProvider(projectModels::get);
}
return builder.build();
} catch (BootstrapMavenException e) {
throw new MojoExecutionException("Failed to initialize Quarkus bootstrap Maven artifact resolver", e);
}
Expand Down
13 changes: 13 additions & 0 deletions docs/pom.xml
Expand Up @@ -2175,6 +2175,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-kotlin-serialization-common-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-links-deployment</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/includes/devtools/create-app.adoc
Expand Up @@ -31,10 +31,10 @@ endif::[]
endif::[]
ifdef::create-app-extensions[]
ifndef::create-app-code[]
--extension={create-app-extensions} \
--extension='{create-app-extensions}' \
endif::[]
ifdef::create-app-code[]
--extension={create-app-extensions}
--extension='{create-app-extensions}'
endif::[]
endif::[]
ifndef::create-app-code[]
Expand Down Expand Up @@ -82,10 +82,10 @@ endif::[]
endif::[]
ifdef::create-app-extensions[]
ifndef::create-app-code[]
-Dextensions="{create-app-extensions}" \
-Dextensions='{create-app-extensions}' \
endif::[]
ifdef::create-app-code[]
-Dextensions="{create-app-extensions}"
-Dextensions='{create-app-extensions}'
endif::[]
endif::[]
ifndef::create-app-code[]
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/includes/devtools/create-cli.adoc
Expand Up @@ -31,10 +31,10 @@ endif::[]
endif::[]
ifdef::create-cli-extensions[]
ifndef::create-cli-code[]
--extension={create-cli-extensions} \
--extension='{create-cli-extensions}' \
endif::[]
ifdef::create-cli-code[]
--extension={create-cli-extensions}
--extension='{create-cli-extensions}'
endif::[]
endif::[]
ifndef::create-cli-code[]
Expand Down Expand Up @@ -72,10 +72,10 @@ ifndef::create-cli-code[]
-DnoCode \
endif::[]
ifdef::create-cli-extensions[]
-Dextensions="picocli,{create-cli-extensions}"
-Dextensions='picocli,{create-cli-extensions}'
endif::[]
ifndef::create-cli-extensions[]
-Dextensions="picocli"
-Dextensions='picocli'
endif::[]
ifdef::create-cli-post-command[]
{create-cli-post-command}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/includes/devtools/extension-add.adoc
Expand Up @@ -8,14 +8,14 @@ ifdef::devtools-wrapped[+]
[source,bash,subs=attributes+,role="secondary asciidoc-tabs-sync-maven"]
.Maven
----
./mvnw quarkus:add-extension -Dextensions="{add-extension-extensions}"
./mvnw quarkus:add-extension -Dextensions='{add-extension-extensions}'
----
endif::[]
ifndef::devtools-no-gradle[]
ifdef::devtools-wrapped[+]
[source,bash,subs=attributes+,role="secondary asciidoc-tabs-sync-gradle"]
.Gradle
----
./gradlew addExtension --extensions="{add-extension-extensions}"
./gradlew addExtension --extensions='{add-extension-extensions}'
----
endif::[]
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/jms.adoc
Expand Up @@ -355,15 +355,15 @@ This creates a new project importing the quarkus-artemis-jms extension:
.pom.xml
----
<dependency>
<groupId>io.quarkus</groupId>
<groupId>io.quarkiverse.artemis</groupId>
<artifactId>quarkus-artemis-jms</artifactId>
</dependency>
----

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
implementation("io.quarkus:quarkus-artemis-jms")
implementation("io.quarkiverse.artemis:quarkus-artemis-jms")
----

With the project created, you can resume from <<starting-the-broker>> in the detailed steps above
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/opentelemetry.adoc
Expand Up @@ -176,7 +176,7 @@ services:
image: otel/opentelemetry-collector:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:Z
ports:
- "13133:13133" # Health_check extension
- "4317:4317" # OTLP gRPC receiver
Expand Down
9 changes: 6 additions & 3 deletions docs/src/main/asciidoc/reactive-event-bus.adoc
Expand Up @@ -267,17 +267,20 @@ The `EventBus` object provides methods to:

1. `send` a message to a specific address - one single consumer receives the message.
2. `publish` a message to a specific address - all consumers receive the messages.
3. `send` a message and expect reply
3. `send` a message and expect reply asynchronously
4. `send` a message and expect reply in a blocking manner

[source, java]
----
// Case 1
bus.sendAndForget("greeting", name)
bus.<String>requestAndForget("greeting", name);
// Case 2
bus.publish("greeting", name)
bus.publish("greeting", name);
// Case 3
Uni<String> response = bus.<String>request("address", "hello, how are you?")
.onItem().transform(Message::body);
// Case 4
String response = bus.<String>requestAndAwait("greeting", name).body();
----

== Putting things together - bridging HTTP and messages
Expand Down
13 changes: 12 additions & 1 deletion docs/src/main/asciidoc/security-keycloak-admin-client.adoc
Expand Up @@ -88,13 +88,24 @@ public class RolesResource {
----
<1> Create a default Keycloak Admin Client which can perform Keycloak `master` realm administration tasks as an `admin-cli` client, such as adding new realms, clients and users.

The only configuration which is required to create this Keycloak Admin Client is a Keycloak server URL, for example:
The only configuration which is required to create this Keycloak Admin Client is a Keycloak server URL.

For example:

[source,properties]
----
# Quarkus based Keycloak distribution
quarkus.keycloak.admin-client.server-url=http://localhost:8081
----

or

[source,properties]
----
# WildFly based Keycloak distribution
quarkus.keycloak.admin-client.server-url=http://localhost:8081/auth
----

[NOTE]
====
It is important that `quarkus.keycloak.admin-client.server-url` is configured if you would like to have `Keycloak` injected. The injection will fail if you attempt to inject `Keycloak` without configuring this property.
Expand Down

0 comments on commit 3d61bd5

Please sign in to comment.