Skip to content

Commit be0632c

Browse files
authored
Merge pull request #43284 from gsmet/3.15.0-backports-1
[3.15] 3.15.0 backports 1
2 parents ddd75d6 + f220a2b commit be0632c

File tree

36 files changed

+1050
-422
lines changed

36 files changed

+1050
-422
lines changed

.github/workflows/ci-actions-incremental.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,12 @@ jobs:
903903
CAPTURE_BUILD_SCAN: true
904904
run: |
905905
git clone --depth=1 -b ${{ steps.get-quickstarts-branch.outputs.result }} https://github.com/quarkusio/quarkus-quickstarts.git && cd quarkus-quickstarts
906-
export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests
906+
if [ "${{ steps.get-quickstarts-branch.outputs.result }}" != "development" ]; then
907+
QUARKUS_VERSION_ARGS="-Dquarkus.platform.version=${{ steps.get-quickstarts-branch.outputs.result }}.999-SNAPSHOT"
908+
else
909+
QUARKUS_VERSION_ARGS=""
910+
fi
911+
export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests -Dquarkus.platform.group-id=io.quarkus $QUARKUS_VERSION_ARGS
907912
- name: Prepare build reports archive
908913
if: always()
909914
run: |

bom/application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<httpasync.version>4.1.5</httpasync.version>
121121
<cronutils.version>9.2.1</cronutils.version>
122122
<quartz.version>2.3.2</quartz.version>
123-
<h2.version>2.3.232</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions
123+
<h2.version>2.3.230</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions
124124
and the dependency jts-core needs to be updated in extensions/jdbc/jdbc-h2/runtime/pom.xml -->
125125
<postgresql-jdbc.version>42.7.4</postgresql-jdbc.version>
126126
<mariadb-jdbc.version>3.4.1</mariadb-jdbc.version>

devtools/gradle/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
plugin-publish = "1.2.2"
2+
plugin-publish = "1.3.0"
33

44
# updating Kotlin here makes QuarkusPluginTest > shouldNotFailOnProjectDependenciesWithoutMain(Path) fail
55
kotlin = "2.0.10"

devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectMojoBase.java

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package io.quarkus.maven;
22

3-
import static io.quarkus.devtools.project.CodestartResourceLoadersBuilder.getCodestartResourceLoaders;
4-
53
import java.io.BufferedWriter;
64
import java.io.IOException;
75
import java.io.StringWriter;
86
import java.nio.file.Path;
97
import java.nio.file.Paths;
108
import java.util.ArrayList;
11-
import java.util.Collections;
129
import java.util.List;
1310

1411
import org.apache.maven.execution.MavenSession;
@@ -18,24 +15,23 @@
1815
import org.apache.maven.plugins.annotations.Component;
1916
import org.apache.maven.plugins.annotations.Parameter;
2017
import org.apache.maven.project.MavenProject;
21-
import org.eclipse.aether.RepositorySystem;
2218
import org.eclipse.aether.RepositorySystemSession;
2319
import org.eclipse.aether.artifact.Artifact;
2420
import org.eclipse.aether.artifact.DefaultArtifact;
25-
import org.eclipse.aether.impl.RemoteRepositoryManager;
2621
import org.eclipse.aether.repository.RemoteRepository;
2722

2823
import io.quarkus.bootstrap.BootstrapConstants;
29-
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenException;
24+
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext;
3025
import io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver;
3126
import io.quarkus.devtools.messagewriter.MessageWriter;
3227
import io.quarkus.devtools.project.BuildTool;
28+
import io.quarkus.devtools.project.CodestartResourceLoadersBuilder;
3329
import io.quarkus.devtools.project.JavaVersion;
3430
import io.quarkus.devtools.project.QuarkusProject;
3531
import io.quarkus.devtools.project.QuarkusProjectHelper;
3632
import io.quarkus.devtools.project.buildfile.MavenProjectBuildFile;
33+
import io.quarkus.maven.components.QuarkusWorkspaceProvider;
3734
import io.quarkus.maven.dependency.ArtifactCoords;
38-
import io.quarkus.maven.utilities.MojoUtils;
3935
import io.quarkus.platform.descriptor.loader.json.ResourceLoader;
4036
import io.quarkus.platform.tools.ToolsConstants;
4137
import io.quarkus.platform.tools.ToolsUtils;
@@ -56,9 +52,6 @@ public abstract class QuarkusProjectMojoBase extends AbstractMojo {
5652
@Parameter(defaultValue = "${session}", readonly = true)
5753
MavenSession session;
5854

59-
@Component
60-
protected RepositorySystem repoSystem;
61-
6255
@Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
6356
protected RepositorySystemSession repoSession;
6457

@@ -75,7 +68,7 @@ public abstract class QuarkusProjectMojoBase extends AbstractMojo {
7568
private String bomVersion;
7669

7770
@Component
78-
RemoteRepositoryManager remoteRepositoryManager;
71+
QuarkusWorkspaceProvider workspaceProvider;
7972

8073
private List<ArtifactCoords> importedPlatforms;
8174

@@ -108,10 +101,14 @@ public void execute() throws MojoExecutionException {
108101
throw new MojoExecutionException("Failed to initialize Quarkus Maven extension manager", e);
109102
}
110103
} else {
111-
final List<ResourceLoader> codestartsResourceLoader = getCodestartResourceLoaders(resolveExtensionCatalog());
112-
quarkusProject = QuarkusProject.of(baseDir(), resolveExtensionCatalog(),
113-
codestartsResourceLoader,
114-
log, buildTool, JavaVersion.NA);
104+
final ExtensionCatalog extensionCatalog = resolveExtensionCatalog();
105+
final List<ResourceLoader> codestartsResourceLoader = CodestartResourceLoadersBuilder
106+
.codestartLoadersBuilder()
107+
.artifactResolver(artifactResolver())
108+
.catalog(extensionCatalog)
109+
.build();
110+
quarkusProject = QuarkusProject.of(baseDir(), extensionCatalog,
111+
codestartsResourceLoader, log, buildTool, JavaVersion.NA);
115112
}
116113

117114
doExecute(quarkusProject, getMessageWriter());
@@ -155,7 +152,7 @@ protected List<ArtifactCoords> getImportedPlatforms() throws MojoExecutionExcept
155152
if (importedPlatforms == null) {
156153
if (project.getFile() == null) {
157154
if (bomGroupId == null && bomArtifactId == null && bomVersion == null) {
158-
return Collections.emptyList();
155+
return List.of();
159156
}
160157
final ExtensionCatalogResolver catalogResolver = getExtensionCatalogResolver();
161158
if (!catalogResolver.hasRegistries()) {
@@ -172,39 +169,35 @@ protected List<ArtifactCoords> getImportedPlatforms() throws MojoExecutionExcept
172169
} catch (RegistryResolutionException e) {
173170
throw new MojoExecutionException("Failed to resolve the catalog of Quarkus platforms", e);
174171
}
175-
return importedPlatforms = Collections.singletonList(platformBom);
172+
return importedPlatforms = List.of(platformBom);
176173
}
177174
importedPlatforms = collectImportedPlatforms();
178175
}
179176
return importedPlatforms;
180177
}
181178

182179
protected MavenArtifactResolver catalogArtifactResolver() throws MojoExecutionException {
183-
return artifactResolver;
180+
return artifactResolver();
184181
}
185182

186183
protected MavenArtifactResolver artifactResolver() throws MojoExecutionException {
187184
return artifactResolver == null ? artifactResolver = initArtifactResolver() : artifactResolver;
188185
}
189186

190187
protected MavenArtifactResolver initArtifactResolver() throws MojoExecutionException {
191-
try {
192-
return MavenArtifactResolver.builder()
193-
.setRepositorySystem(repoSystem)
194-
.setRepositorySystemSession(
195-
getLog().isDebugEnabled() ? repoSession : MojoUtils.muteTransferListener(repoSession))
196-
.setRemoteRepositories(repos)
197-
.setRemoteRepositoryManager(remoteRepositoryManager)
198-
.build();
199-
} catch (BootstrapMavenException e) {
200-
throw new MojoExecutionException("Failed to initialize Maven artifact resolver", e);
201-
}
188+
var config = BootstrapMavenContext.config()
189+
.setArtifactTransferLogging(getLog().isDebugEnabled())
190+
.setRemoteRepositoryManager(workspaceProvider.getRemoteRepositoryManager())
191+
.setRepositorySystem(workspaceProvider.getRepositorySystem())
192+
.setRemoteRepositories(repos)
193+
.setWorkspaceDiscovery(false)
194+
.setRepositorySystemSession(repoSession);
195+
return workspaceProvider.createArtifactResolver(config);
202196
}
203197

204-
private List<ArtifactCoords> collectImportedPlatforms()
205-
throws MojoExecutionException {
198+
private List<ArtifactCoords> collectImportedPlatforms() {
206199
final List<ArtifactCoords> descriptors = new ArrayList<>(4);
207-
final List<Dependency> constraints = project.getDependencyManagement() == null ? Collections.emptyList()
200+
final List<Dependency> constraints = project.getDependencyManagement() == null ? List.of()
208201
: project.getDependencyManagement().getDependencies();
209202
if (!constraints.isEmpty()) {
210203
final MessageWriter log = getMessageWriter();
@@ -222,17 +215,6 @@ private List<ArtifactCoords> collectImportedPlatforms()
222215
return descriptors;
223216
}
224217

225-
private String getQuarkusCoreVersion() {
226-
final List<Dependency> constraints = project.getDependencyManagement() == null ? Collections.emptyList()
227-
: project.getDependencyManagement().getDependencies();
228-
for (Dependency d : constraints) {
229-
if (d.getArtifactId().endsWith("quarkus-core") && d.getGroupId().equals("io.quarkus")) {
230-
return d.getVersion();
231-
}
232-
}
233-
return null;
234-
}
235-
236218
protected void validateParameters() throws MojoExecutionException {
237219
}
238220

@@ -241,8 +223,8 @@ protected abstract void doExecute(QuarkusProject quarkusProject, MessageWriter l
241223

242224
private Artifact projectArtifact() {
243225
return projectArtifact == null
244-
? projectArtifact = new DefaultArtifact(project.getGroupId(), project.getArtifactId(), null, "pom",
245-
project.getVersion())
226+
? projectArtifact = new DefaultArtifact(project.getGroupId(), project.getArtifactId(), null,
227+
ArtifactCoords.TYPE_POM, project.getVersion())
246228
: projectArtifact;
247229
}
248230

devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected MavenArtifactResolver catalogArtifactResolver() throws MojoExecutionEx
141141
protected MavenArtifactResolver initArtifactResolver() throws MojoExecutionException {
142142
return workspaceProvider.createArtifactResolver(BootstrapMavenContext.config()
143143
.setUserSettings(session.getRequest().getUserSettingsFile())
144-
.setRemoteRepositoryManager(remoteRepositoryManager)
144+
.setRemoteRepositoryManager(workspaceProvider.getRemoteRepositoryManager())
145145
// The system needs to be initialized with the bootstrap model builder to properly interpolate system properties set on the command line
146146
// e.g. -Dquarkus.platform.version=xxx
147147
//.setRepositorySystem(workspaceProvider.getRepositorySystem())

docs/src/main/asciidoc/amqp-reference.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,19 @@ public AmqpClientOptions getNamedOptions() {
478478
}
479479
----
480480

481+
== TLS Configuration
482+
483+
AMQP 1.0 Messaging extension integrates with the xref:./tls-registry-reference.adoc[Quarkus TLS registry] to configure the Vert.x AMQP client.
484+
485+
To configure the TLS for an AMQP 1.0 channel, you need to provide a named TLS configuration in the `application.properties`:
486+
487+
[source, properties]
488+
----
489+
quarkus.tls.your-tls-config.trust-store.pem.certs=ca.crt,ca2.pem
490+
# ...
491+
mp.messaging.incoming.prices.tls-configuration-name=your-tls-config
492+
----
493+
481494
== Health reporting
482495

483496
If you use the AMQP connector with the `quarkus-smallrye-health` extension, it contributes to the readiness and liveness probes.

docs/src/main/asciidoc/hibernate-orm.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,9 @@ and annotating the implementation with the appropriate qualifiers:
13951395

13961396
[source,java]
13971397
----
1398+
import io.quarkus.hibernate.orm.JsonFormat;
1399+
import org.hibernate.type.format.FormatMapper;
1400+
13981401
@JsonFormat // <1>
13991402
@PersistenceUnitExtension // <2>
14001403
public class MyJsonFormatMapper implements FormatMapper { // <3>
@@ -1412,6 +1415,9 @@ public class MyJsonFormatMapper implements FormatMapper { // <3>
14121415
<1> Annotate the format mapper implementation with the `@JsonFormat` qualifier
14131416
to tell Quarkus that this mapper is specific to JSON serialization/deserialization.
14141417
+
1418+
WARNING: Make sure the Quarkus-specific `@io.quarkus.hibernate.orm.JsonFormat` annotation is used
1419+
and not the one from Jackson.
1420+
+
14151421
<2> Annotate the format mapper implementation with the `@PersistenceUnitExtension` qualifier
14161422
to tell Quarkus it should be used in the default persistence unit.
14171423
+
@@ -1422,6 +1428,9 @@ In case of a custom XML format mapper, a different CDI qualifier must be applied
14221428

14231429
[source,java]
14241430
----
1431+
import io.quarkus.hibernate.orm.XmlFormat;
1432+
import org.hibernate.type.format.FormatMapper;
1433+
14251434
@XmlFormat // <1>
14261435
@PersistenceUnitExtension // <2>
14271436
public class MyJsonFormatMapper implements FormatMapper { // <3>

docs/src/main/asciidoc/kafka.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,36 @@ Update the `oauth.client.id`, `oauth.client.secret` and `oauth.token.endpoint.ur
21532153

21542154
OAuth authentication works for both JVM and native modes. Since SSL in not enabled by default in native mode, `quarkus.ssl.native=true` must be added to support JaasClientOauthLoginCallbackHandler, which uses SSL. (See the xref:native-and-ssl.adoc[Using SSL with Native Executables] guide for more details.)
21552155

2156+
== TLS Configuration
2157+
2158+
Kafka client extension integrates with the xref:./tls-registry-reference.adoc[Quarkus TLS registry] to configure clients.
2159+
2160+
To configure the TLS for the default Kafka configuration, you need to provide a named TLS configuration in the `application.properties`:
2161+
2162+
[source, properties]
2163+
----
2164+
quarkus.tls.your-tls-config.trust-store.pem.certs=target/certs/kafka.crt,target/certs/kafka-ca.crt
2165+
# ...
2166+
kafka.tls-configuration-name=your-tls-config
2167+
# enable ssl security protocol
2168+
kafka.security.protocol=ssl
2169+
----
2170+
2171+
This will in turn provide the Kafka client with a `ssl.engine.factory.class` implementation.
2172+
2173+
[IMPORTANT]
2174+
====
2175+
Make sure also to enable the SSL channel security protocol using the `security.protocol` property configured to `SSL` or `SASL_SSL`.
2176+
====
2177+
2178+
Quarkus Messaging channels can be configured individually to use a specific TLS configuration:
2179+
2180+
[source, properties]
2181+
----
2182+
mp.messaging.incoming.your-channel.tls-configuration-name=your-tls-config
2183+
mp.messaging.incoming.your-channel.security.protocol=ssl
2184+
----
2185+
21562186
== Testing a Kafka application
21572187

21582188
=== Testing without a broker

docs/src/main/asciidoc/messaging.adoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,33 @@ You can disable tracing for a specific channel using the following configuration
600600
mp.messaging.incoming.data.tracing-enabled=false
601601
----
602602

603+
== TLS Configuration
604+
605+
Some messaging extensions integrate with the xref:./tls-registry-reference.adoc[Quarkus TLS Registry] to configure the underlying client.
606+
To configure the TLS on a channel, you need to provide the named TLS configuration to the `tls-configuration-name` property:
607+
608+
[source, properties]
609+
----
610+
quarkus.tls.my-tls-config.trust-store=truststore.jks
611+
quarkus.tls.my-tls-config.trust-store-password=secret
612+
mp.messaging.incoming.my-channel.tls-configuration-name=my-tls-config
613+
----
614+
615+
Or you can configure it globally on all channels of a connector:
616+
617+
[source, properties]
618+
----
619+
mp.messaging.connector.smallrye-pulsar.tls-configuration-name=my-tls-config
620+
----
621+
622+
Currently, the following messaging extensions support configuration through the Quarkus TLS Registry:
623+
624+
* Kafka: Provides the `ssl.engine.factory.class` property for the Kafka client.
625+
* Pulsar: Only mTLS authentication is supported.
626+
* RabbitMQ
627+
* AMQP 1.0
628+
* MQTT
629+
603630
== Testing
604631

605632
=== Testing with Dev Services

docs/src/main/asciidoc/pulsar-getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ version: '3.8'
405405
services:
406406
407407
pulsar:
408-
image: apachepulsar/pulsar:3.0.0
408+
image: apachepulsar/pulsar:3.2.4
409409
command: [
410410
"sh", "-c",
411411
"bin/apply-config-from-env.py conf/standalone.conf && bin/pulsar standalone -nfw -nss"

0 commit comments

Comments
 (0)