From 4a4bf00322c87dcda7360c0d8bcf43f822b3c480 Mon Sep 17 00:00:00 2001 From: Matheus Cruz Date: Tue, 6 Feb 2024 14:35:12 -0300 Subject: [PATCH 01/11] Add globbing pattern to cli-tooling.adoc (cherry picked from commit 7786c2c8a8279ae7765699185b616bc4b7d88242) --- docs/src/main/asciidoc/cli-tooling.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/main/asciidoc/cli-tooling.adoc b/docs/src/main/asciidoc/cli-tooling.adoc index d363697be730a..74255a9653b13 100644 --- a/docs/src/main/asciidoc/cli-tooling.adoc +++ b/docs/src/main/asciidoc/cli-tooling.adoc @@ -476,6 +476,12 @@ quarkus ext add kubernetes health [SUCCESS] ✅ Extension io.quarkus:quarkus-smallrye-health has been installed ---- +You can install all extensions which match a glob pattern: +[source,shell] +---- +quarkus ext add smallrye-* +---- + ==== Removing extensions The Quarkus CLI can remove one or more extensions from your project with the `remove`/`rm` From 743081945d1ee52738c06fb41bb02a2be01ea7a4 Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Tue, 6 Feb 2024 18:26:55 +0000 Subject: [PATCH 02/11] Set quarkus-oidc-token-propagation-reactive status to stable (cherry picked from commit 32980d3ded271fc78c9a36463fd0e2eb2cfb1565) --- .../runtime/src/main/resources/META-INF/quarkus-extension.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/oidc-token-propagation-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/oidc-token-propagation-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml index f01498b88fcf6..39a8117a0d3a2 100644 --- a/extensions/oidc-token-propagation-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/oidc-token-propagation-reactive/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -11,6 +11,6 @@ metadata: guide: "https://quarkus.io/guides/security-openid-connect-client" categories: - "security" - status: "preview" + status: "stable" config: - "quarkus.oidc-token-propagation-reactive." From 520a61ee135c44b91667533cb27bf08db70c0019 Mon Sep 17 00:00:00 2001 From: Bas Passon Date: Wed, 7 Feb 2024 13:50:36 +0100 Subject: [PATCH 03/11] Fixes #38543 - LinksProcessor ID field error for native class HalCollectionWrapper (cherry picked from commit 9855040131e54c46ed4d8ef1a0ee587a3461b595) --- docs/src/main/asciidoc/resteasy-reactive.adoc | 12 ++-- .../io/quarkus/hal/HalCollectionWrapper.java | 10 +-- ...HalCollectionWrapperJacksonSerializer.java | 10 +-- .../HalCollectionWrapperJsonbSerializer.java | 8 ++- .../java/io/quarkus/hal/HalEntityWrapper.java | 10 +-- .../HalEntityWrapperJacksonSerializer.java | 2 +- .../hal/HalEntityWrapperJsonbSerializer.java | 2 + .../main/java/io/quarkus/hal/HalService.java | 12 ++-- .../deployment/pom.xml | 5 ++ .../links/deployment/HalWrapperResource.java | 63 ++++++++++++++++++ .../deployment/HalWrapperResourceTest.java | 65 +++++++++++++++++++ 11 files changed, 168 insertions(+), 31 deletions(-) create mode 100644 extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResource.java create mode 100644 extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResourceTest.java diff --git a/docs/src/main/asciidoc/resteasy-reactive.adoc b/docs/src/main/asciidoc/resteasy-reactive.adoc index 1b456e8b94b5f..c5f77edcd6eb4 100644 --- a/docs/src/main/asciidoc/resteasy-reactive.adoc +++ b/docs/src/main/asciidoc/resteasy-reactive.adoc @@ -1869,7 +1869,7 @@ When we call a resource `/records/1` that returns only one instance, then the ou } ---- -Finally, you can also provide additional HAL links programmatically in your resource just by returning either `HalCollectionWrapper` (to return a list of entities) or `HalEntityWrapper` (to return a single object) as described in the following example: +Finally, you can also provide additional HAL links programmatically in your resource just by returning either `HalCollectionWrapper` (to return a list of entities) or `HalEntityWrapper` (to return a single object) as described in the following example: [source,java] ---- @@ -1877,14 +1877,14 @@ Finally, you can also provide additional HAL links programmatically in your reso public class RecordsResource { @Inject - RestLinksProvider linksProvider; + HalService halService; @GET @Produces({ MediaType.APPLICATION_JSON, RestMediaType.APPLICATION_HAL_JSON }) @RestLink(rel = "list") - public HalCollectionWrapper getAll() { + public HalCollectionWrapper getAll() { List list = // ... - HalCollectionWrapper halCollection = new HalCollectionWrapper(list, "collectionName", linksProvider.getTypeLinks(Record.class)); + HalCollectionWrapper halCollection = halService.toHalCollectionWrapper( list, "collectionName", Record.class); halCollection.addLinks(Link.fromPath("/records/1").rel("first-record").build()); return halCollection; } @@ -1894,9 +1894,9 @@ public class RecordsResource { @Path("/{id}") @RestLink(rel = "self") @InjectRestLinks(RestLinkType.INSTANCE) - public HalEntityWrapper get(@PathParam("id") int id) { + public HalEntityWrapper get(@PathParam("id") int id) { Record entity = // ... - HalEntityWrapper halEntity = new HalEntityWrapper(entity, linksProvider.getInstanceLinks(entity)); + HalEntityWrapper halEntity = halService.toHalWrapper(entity); halEntity.addLinks(Link.fromPath("/records/1/parent").rel("parent-record").build()); return halEntity; } diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapper.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapper.java index 1a0caa75f83b5..fc86a00e6e6ff 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapper.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapper.java @@ -14,25 +14,25 @@ * - the JSON-B serializer: {@link HalCollectionWrapperJsonbSerializer} * - the Jackson serializer: {@link HalCollectionWrapperJacksonSerializer} */ -public class HalCollectionWrapper extends HalWrapper { +public class HalCollectionWrapper extends HalWrapper { - private final Collection collection; + private final Collection> collection; private final String collectionName; - public HalCollectionWrapper(Collection collection, String collectionName, Link... links) { + public HalCollectionWrapper(Collection> collection, String collectionName, Link... links) { this(collection, collectionName, new HashMap<>()); addLinks(links); } - public HalCollectionWrapper(Collection collection, String collectionName, Map links) { + public HalCollectionWrapper(Collection> collection, String collectionName, Map links) { super(links); this.collection = collection; this.collectionName = collectionName; } - public Collection getCollection() { + public Collection> getCollection() { return collection; } diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJacksonSerializer.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJacksonSerializer.java index a922f9cec1c0b..82694c1e45ac5 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJacksonSerializer.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJacksonSerializer.java @@ -6,10 +6,10 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; -public class HalCollectionWrapperJacksonSerializer extends JsonSerializer { +public class HalCollectionWrapperJacksonSerializer extends JsonSerializer> { @Override - public void serialize(HalCollectionWrapper wrapper, JsonGenerator generator, SerializerProvider serializers) + public void serialize(HalCollectionWrapper wrapper, JsonGenerator generator, SerializerProvider serializers) throws IOException { generator.writeStartObject(); writeEmbedded(wrapper, generator, serializers); @@ -17,7 +17,7 @@ public void serialize(HalCollectionWrapper wrapper, JsonGenerator generator, Ser generator.writeEndObject(); } - private void writeEmbedded(HalCollectionWrapper wrapper, JsonGenerator generator, SerializerProvider serializers) + private void writeEmbedded(HalCollectionWrapper wrapper, JsonGenerator generator, SerializerProvider serializers) throws IOException { JsonSerializer entitySerializer = serializers.findValueSerializer(HalEntityWrapper.class); @@ -25,14 +25,14 @@ private void writeEmbedded(HalCollectionWrapper wrapper, JsonGenerator generator generator.writeStartObject(); generator.writeFieldName(wrapper.getCollectionName()); generator.writeStartArray(); - for (HalEntityWrapper entity : wrapper.getCollection()) { + for (HalEntityWrapper entity : wrapper.getCollection()) { entitySerializer.serialize(entity, generator, serializers); } generator.writeEndArray(); generator.writeEndObject(); } - private void writeLinks(HalCollectionWrapper wrapper, JsonGenerator generator) throws IOException { + private void writeLinks(HalCollectionWrapper wrapper, JsonGenerator generator) throws IOException { generator.writeFieldName("_links"); generator.writeObject(wrapper.getLinks()); } diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJsonbSerializer.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJsonbSerializer.java index 16ab71e68eafd..bf9964d4d89ad 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJsonbSerializer.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalCollectionWrapperJsonbSerializer.java @@ -4,6 +4,8 @@ import jakarta.json.bind.serializer.SerializationContext; import jakarta.json.stream.JsonGenerator; +// Using the raw type here as eclipse yasson doesn't like custom serializers for +// generic root types, see https://github.com/eclipse-ee4j/yasson/issues/639 public class HalCollectionWrapperJsonbSerializer implements JsonbSerializer { @Override @@ -14,19 +16,19 @@ public void serialize(HalCollectionWrapper wrapper, JsonGenerator generator, Ser generator.writeEnd(); } - private void writeEmbedded(HalCollectionWrapper wrapper, JsonGenerator generator, SerializationContext context) { + private void writeEmbedded(HalCollectionWrapper wrapper, JsonGenerator generator, SerializationContext context) { generator.writeKey("_embedded"); generator.writeStartObject(); generator.writeKey(wrapper.getCollectionName()); generator.writeStartArray(); - for (HalEntityWrapper entity : wrapper.getCollection()) { + for (HalEntityWrapper entity : wrapper.getCollection()) { context.serialize(entity, generator); } generator.writeEnd(); generator.writeEnd(); } - private void writeLinks(HalCollectionWrapper wrapper, JsonGenerator generator, SerializationContext context) { + private void writeLinks(HalCollectionWrapper wrapper, JsonGenerator generator, SerializationContext context) { context.serialize("_links", wrapper.getLinks(), generator); } } diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapper.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapper.java index c908213f4dab5..0c1b18f58f651 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapper.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapper.java @@ -12,23 +12,23 @@ * - the JSON-B serializer: {@link HalEntityWrapperJsonbSerializer} * - the Jackson serializer: {@link HalEntityWrapperJacksonSerializer} */ -public class HalEntityWrapper extends HalWrapper { +public class HalEntityWrapper extends HalWrapper { - private final Object entity; + private final T entity; - public HalEntityWrapper(Object entity, Link... links) { + public HalEntityWrapper(T entity, Link... links) { this(entity, new HashMap<>()); addLinks(links); } - public HalEntityWrapper(Object entity, Map links) { + public HalEntityWrapper(T entity, Map links) { super(links); this.entity = entity; } - public Object getEntity() { + public T getEntity() { return entity; } } diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJacksonSerializer.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJacksonSerializer.java index 58e27950e82eb..d64b30ff54c86 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJacksonSerializer.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJacksonSerializer.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.databind.introspect.BasicClassIntrospector; import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; -public class HalEntityWrapperJacksonSerializer extends JsonSerializer { +public class HalEntityWrapperJacksonSerializer extends JsonSerializer> { @Override public void serialize(HalEntityWrapper wrapper, JsonGenerator generator, SerializerProvider serializers) diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJsonbSerializer.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJsonbSerializer.java index 990febd478606..dc19ead70ebf9 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJsonbSerializer.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalEntityWrapperJsonbSerializer.java @@ -10,6 +10,8 @@ import org.eclipse.yasson.internal.model.ClassModel; import org.eclipse.yasson.internal.model.PropertyModel; +// Using the raw type here as eclipse yasson doesn't like custom serializers for +// generic root types, see https://github.com/eclipse-ee4j/yasson/issues/639 public class HalEntityWrapperJsonbSerializer implements JsonbSerializer { @Override diff --git a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalService.java b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalService.java index a4fc08cf0bcc9..0f779c7c856a6 100644 --- a/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalService.java +++ b/extensions/hal/runtime/src/main/java/io/quarkus/hal/HalService.java @@ -24,10 +24,10 @@ public abstract class HalService { * @param entityClass The class of the objects in the collection. If null, it will not resolve the links for these objects. * @return The Hal collection wrapper instance. */ - public HalCollectionWrapper toHalCollectionWrapper(Collection collection, String collectionName, + public HalCollectionWrapper toHalCollectionWrapper(Collection collection, String collectionName, Class entityClass) { - List items = new ArrayList<>(); - for (Object entity : collection) { + List> items = new ArrayList<>(); + for (T entity : collection) { items.add(toHalWrapper(entity)); } @@ -36,7 +36,7 @@ public HalCollectionWrapper toHalCollectionWrapper(Collection collection classLinks = getClassLinks(entityClass); } - return new HalCollectionWrapper(items, collectionName, classLinks); + return new HalCollectionWrapper<>(items, collectionName, classLinks); } /** @@ -45,8 +45,8 @@ public HalCollectionWrapper toHalCollectionWrapper(Collection collection * @param entity The entity to wrap. * @return The Hal entity wrapper. */ - public HalEntityWrapper toHalWrapper(Object entity) { - return new HalEntityWrapper(entity, getInstanceLinks(entity)); + public HalEntityWrapper toHalWrapper(T entity) { + return new HalEntityWrapper<>(entity, getInstanceLinks(entity)); } /** diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/pom.xml index d22a41c9656d3..564f0202cfe37 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/pom.xml @@ -21,6 +21,11 @@ io.quarkus quarkus-resteasy-reactive-deployment + + io.quarkus + quarkus-hal-deployment + test + io.quarkus quarkus-junit5-internal diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResource.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResource.java new file mode 100644 index 0000000000000..1d57b81db96c0 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResource.java @@ -0,0 +1,63 @@ +package io.quarkus.resteasy.reactive.links.deployment; + +import java.util.List; + +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Link; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.UriInfo; + +import org.jboss.resteasy.reactive.common.util.RestMediaType; + +import io.quarkus.hal.HalCollectionWrapper; +import io.quarkus.hal.HalEntityWrapper; +import io.quarkus.hal.HalService; +import io.quarkus.resteasy.reactive.links.InjectRestLinks; +import io.quarkus.resteasy.reactive.links.RestLink; +import io.quarkus.resteasy.reactive.links.RestLinkType; + +@Path("/hal") +public class HalWrapperResource { + + @Inject + HalService halService; + + @GET + @Produces({ MediaType.APPLICATION_JSON, RestMediaType.APPLICATION_HAL_JSON }) + @RestLink(rel = "list") + @InjectRestLinks + public HalCollectionWrapper getRecords(@Context UriInfo uriInfo) { + List items = List.of( + new TestRecordWithIdAndPersistenceIdAndRestLinkId(1, 10, 100, "one"), + new TestRecordWithIdAndPersistenceIdAndRestLinkId(2, 20, 200, "two")); + + HalCollectionWrapper halCollection = halService.toHalCollectionWrapper( + items, + "collectionName", TestRecordWithIdAndPersistenceIdAndRestLinkId.class); + halCollection.addLinks( + Link.fromUriBuilder(uriInfo.getBaseUriBuilder().path(String.format("/hal/%d", 1))).rel("first-record").build()); + + return halCollection; + } + + @GET + @Path("/{id}") + @Produces({ MediaType.APPLICATION_JSON, RestMediaType.APPLICATION_HAL_JSON }) + @RestLink(rel = "self") + @InjectRestLinks(RestLinkType.INSTANCE) + public HalEntityWrapper getRecord(@PathParam("id") int id, + @Context UriInfo uriInfo) { + + HalEntityWrapper halEntity = halService.toHalWrapper( + new TestRecordWithIdAndPersistenceIdAndRestLinkId(1, 10, 100, "one")); + halEntity.addLinks(Link.fromUriBuilder(uriInfo.getBaseUriBuilder().path(String.format("/hal/%d/parent", id))) + .rel("parent-record").build()); + + return halEntity; + } +} diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResourceTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResourceTest.java new file mode 100644 index 0000000000000..5a2c426416f1c --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-links/deployment/src/test/java/io/quarkus/resteasy/reactive/links/deployment/HalWrapperResourceTest.java @@ -0,0 +1,65 @@ +package io.quarkus.resteasy.reactive.links.deployment; + +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; + +import jakarta.ws.rs.core.HttpHeaders; + +import org.jboss.resteasy.reactive.common.util.RestMediaType; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.builder.Version; +import io.quarkus.maven.dependency.Dependency; +import io.quarkus.test.QuarkusUnitTest; +import io.quarkus.test.common.http.TestHTTPResource; +import io.restassured.response.Response; + +public class HalWrapperResourceTest { + + @RegisterExtension + static final QuarkusUnitTest TEST = new QuarkusUnitTest() + .withApplicationRoot((jar) -> jar + .addClasses(HalWrapperResource.class, TestRecordWithIdAndPersistenceIdAndRestLinkId.class)) + .setForcedDependencies(List.of( + Dependency.of("io.quarkus", "quarkus-resteasy-reactive-jackson", Version.getVersion()), + Dependency.of("io.quarkus", "quarkus-hal", Version.getVersion()))); + + @TestHTTPResource("hal") + String recordsUrl; + + @TestHTTPResource("hal/{id}") + String recordIdUrl; + + @Test + void shouldGetAllRecordsWithCustomHalMetadata() { + Response response = given() + .header(HttpHeaders.ACCEPT, RestMediaType.APPLICATION_HAL_JSON) + .get(recordsUrl).thenReturn(); + + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][0].restLinkId")).isEqualTo("1"); + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][0]._links.self.href")).endsWith("/hal/1"); + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][0]._links.list.href")).endsWith("/hal"); + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][1].restLinkId")).isEqualTo("2"); + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][1]._links.self.href")).endsWith("/hal/2"); + assertThat(response.body().jsonPath().getString("_embedded['collectionName'][1]._links.list.href")).endsWith("/hal"); + assertThat(response.body().jsonPath().getString("_links.first-record.href")).endsWith("/hal/1"); + assertThat(response.body().jsonPath().getString("_links.list.href")).endsWith("/hal"); + } + + @Test + void shouldGetSingleRecordWithCustomHalMetadata() { + Response response = given() + .header(HttpHeaders.ACCEPT, RestMediaType.APPLICATION_HAL_JSON) + .get(recordIdUrl, 1L) + .thenReturn(); + + assertThat(response.body().jsonPath().getString("restLinkId")).isEqualTo("1"); + assertThat(response.body().jsonPath().getString("_links.parent-record.href")).endsWith("/hal/1/parent"); + assertThat(response.body().jsonPath().getString("_links.self.href")).endsWith("/hal/1"); + assertThat(response.body().jsonPath().getString("_links.list.href")).endsWith("/hal"); + + } +} From e26550676381a92fda2def9321dd6b9b2d04e729 Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Wed, 7 Feb 2024 10:51:29 +1100 Subject: [PATCH 04/11] Move Dev UI locking back to Quarkus BOM Signed-off-by: Phillip Kruger (cherry picked from commit 627bfa89586aa86ccb0b0a6de0477d91ecf09a6a) --- bom/application/pom.xml | 11 +- bom/dev-ui/pom.xml | 280 ++++++++++++++++++++++++++++++++++++++++ build-parent/pom.xml | 243 ---------------------------------- pom.xml | 1 + 4 files changed, 291 insertions(+), 244 deletions(-) create mode 100644 bom/dev-ui/pom.xml diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 6272b828e022c..6afef24acfde4 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -255,7 +255,16 @@ pom import - + + + + io.quarkus + quarkus-bom-dev-ui + ${project.version} + pom + import + + diff --git a/bom/dev-ui/pom.xml b/bom/dev-ui/pom.xml new file mode 100644 index 0000000000000..be2f1cc71d1ae --- /dev/null +++ b/bom/dev-ui/pom.xml @@ -0,0 +1,280 @@ + + 4.0.0 + + io.quarkus + quarkus-project + 999-SNAPSHOT + ../../pom.xml + + quarkus-bom-dev-ui + Quarkus - BOM - Dev UI + pom + + Dependency management for dev-ui. Importable by third party extension developers. + + + 24.3.5 + 3.1.2 + 4.0.4 + 3.1.2 + 1.2.0 + 2.0.7 + 2.0.4 + 2.1.2 + 2.0.6 + 3.5.1 + 1.11.2 + 1.4.0 + 1.7.5 + 1.7.0 + 5.4.3 + 2.1.0 + 1.8.2 + 2.4.0 + + 2.15.3 + 17.7.2 + 8.0.1 + 3.1.2 + 2.0.5 + 2.1.1 + 4.2.3 + 5.0.8 + 21.1.1 + 6.0.1 + 7.0.0 + 8.0.0 + 3.0.0 + 5.0.1 + 4.3.0 + 2.0.1 + 1.1.4 + + + + + + + org.mvnpm.at.vaadin + router + ${vaadin-router.version} + runtime + + + org.mvnpm + path-to-regexp + ${path-to-regexp.version} + runtime + + + + org.mvnpm.at.mvnpm + vaadin-webcomponents + ${vaadin.version} + runtime + + + org.mvnpm.at.vaadin + vaadin-usage-statistics + ${vaadin-usage-statistics.version} + runtime + + + org.mvnpm.at.vaadin + vaadin-development-mode-detector + ${vaadin-development-mode-detector.version} + runtime + + + org.mvnpm.at.polymer + polymer + ${polymer.version} + runtime + + + org.mvnpm.at.webcomponents + shadycss + ${shadycss.version} + runtime + + + org.mvnpm.at.open-wc + dedupe-mixin + ${dedupe-mixin.version} + runtime + + + + + org.mvnpm + lit + ${lit.version} + runtime + + + org.mvnpm.at.lit + reactive-element + ${reactive-element.version} + runtime + + + org.mvnpm + lit-element + ${lit-element.version} + runtime + + + org.mvnpm + lit-html + ${lit-html.version} + runtime + + + org.mvnpm.at.lit-labs + ssr-dom-shim + ${ssr-dom-shim.version} + runtime + + + org.mvnpm.at.types + trusted-types + ${trusted-types.version} + runtime + + + org.mvnpm + lit-element-state + ${lit-state.version} + runtime + + + + + org.mvnpm + echarts + ${echarts.version} + runtime + + + + + org.mvnpm.at.hpcc-js + wasm + ${hpcc-js-wasm.version} + runtime + + + org.mvnpm + yargs + ${yargs.version} + runtime + + + org.mvnpm + cliui + ${cliui.version} + runtime + + + org.mvnpm + escalade + ${escalade.version} + runtime + + + org.mvnpm + get-caller-file + ${get-caller-file.version} + runtime + + + org.mvnpm + require-directory + ${require-directory.version} + runtime + + + org.mvnpm + string-width + ${string-width.version} + runtime + + + org.mvnpm + y18n + ${y18n.version} + runtime + + + org.mvnpm + yargs-parser + ${yargs-parser.version} + runtime + + + org.mvnpm + strip-ansi + ${strip-ansi.version} + runtime + + + org.mvnpm + wrap-ansi + ${wrap-ansi.version} + runtime + + + org.mvnpm + emoji-regex + ${emoji-regex} + runtime + + + org.mvnpm + is-fullwidth-code-point + ${is-fullwidth-code-point.version} + runtime + + + org.mvnpm + ansi-regex + ${ansi-regex.version} + runtime + + + org.mvnpm + ansi-styles + ${ansi-styles.version} + runtime + + + org.mvnpm + color-convert + ${color-convert.version} + runtime + + + org.mvnpm + color-name + ${color-name.version} + runtime + + + + + org.mvnpm.at.vanillawc + wc-codemirror + ${wc-codemirror.version} + runtime + + + + + org.mvnpm + es-module-shims + ${es-module-shims.version} + runtime + + + + diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 12723478a4892..29a07126bf6f2 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -174,26 +174,6 @@ 1.1.0 true - - - 24.3.0 - 3.1.0 - 4.0.2 - 3.1.0 - 1.1.2 - 2.0.7 - 2.0.2 - 2.1.2 - 2.0.6 - 3.5.1 - 1.11.2 - 1.4.0 - 1.7.5 - 1.7.0 - 5.4.3 - 2.1.0 - 1.8.2 - 2.4.0 @@ -393,229 +373,6 @@ - - - - org.mvnpm.at.vaadin - router - ${vaadin-router.version} - runtime - - - org.mvnpm - path-to-regexp - ${path-to-regexp.version} - runtime - - - - org.mvnpm.at.mvnpm - vaadin-webcomponents - ${vaadin.version} - runtime - - - org.mvnpm.at.vaadin - vaadin-usage-statistics - ${vaadin-usage-statistics.version} - runtime - - - org.mvnpm.at.vaadin - vaadin-development-mode-detector - ${vaadin-development-mode-detector.version} - runtime - - - org.mvnpm.at.polymer - polymer - ${polymer.version} - runtime - - - org.mvnpm.at.webcomponents - shadycss - ${shadycss.version} - runtime - - - org.mvnpm.at.open-wc - dedupe-mixin - ${dedupe-mixin.version} - runtime - - - - - org.mvnpm - lit - ${lit.version} - runtime - - - org.mvnpm.at.lit - reactive-element - ${reactive-element.version} - runtime - - - org.mvnpm - lit-element - ${lit-element.version} - runtime - - - org.mvnpm - lit-html - ${lit-html.version} - runtime - - - org.mvnpm.at.lit-labs - ssr-dom-shim - ${ssr-dom-shim.version} - runtime - - - org.mvnpm.at.types - trusted-types - ${trusted-types.version} - runtime - - - org.mvnpm - lit-element-state - ${lit-state.version} - runtime - - - - - org.mvnpm - echarts - ${echarts.version} - runtime - - - - - org.mvnpm.at.hpcc-js - wasm - 2.14.1 - runtime - - - org.mvnpm - yargs - 17.7.2 - runtime - - - org.mvnpm - cliui - 8.0.1 - runtime - - - org.mvnpm - escalade - 3.1.1 - runtime - - - org.mvnpm - get-caller-file - 2.0.5 - runtime - - - org.mvnpm - require-directory - 2.1.1 - runtime - - - org.mvnpm - string-width - 4.2.3 - runtime - - - org.mvnpm - y18n - 5.0.8 - runtime - - - org.mvnpm - yargs-parser - 21.1.1 - runtime - - - org.mvnpm - strip-ansi - 6.0.1 - runtime - - - org.mvnpm - wrap-ansi - 7.0.0 - runtime - - - org.mvnpm - emoji-regex - 8.0.0 - runtime - - - org.mvnpm - is-fullwidth-code-point - 3.0.0 - runtime - - - org.mvnpm - ansi-regex - 5.0.1 - runtime - - - org.mvnpm - ansi-styles - 4.3.0 - runtime - - - org.mvnpm - color-convert - 2.0.1 - runtime - - - org.mvnpm - color-name - 1.1.4 - runtime - - - - - org.mvnpm.at.vanillawc - wc-codemirror - ${wc-codemirror.version} - runtime - - - - - org.mvnpm - es-module-shims - ${es-module-shims.version} - runtime - diff --git a/pom.xml b/pom.xml index 315503ad9c4b5..82f3fe1616e94 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,7 @@ bom/application bom/test + bom/dev-ui build-parent From 2cbfb677ac265d6c43ecee79312dbc6ef48baff6 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Wed, 7 Feb 2024 08:51:43 +0100 Subject: [PATCH 05/11] Update Vert.x to version 4.5.3 The only detected breaking changes are related to the vertx-mutiny-http-proxy module which is not used in Quarkus. Full release notes are there: https://github.com/vert-x3/wiki/wiki/4.5.3-Release-Notes. Important: - Fix CVE-2024-1300 io.vertx:vertx-core: memory leak when a TCP server is configured with TLS and SNI support - Fix the classloading issue for NVMPN and WebJars in dev mode (https://github.com/quarkusio/quarkus/issues/38576) (cherry picked from commit 7bcbb9985829a2c171f922daf525aa6b4c4b990d) --- bom/application/pom.xml | 2 +- independent-projects/resteasy-reactive/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 6afef24acfde4..3bf07f8fd263d 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -121,7 +121,7 @@ 1.0.1.Final 2.2.3.Final 3.5.1.Final - 4.5.2 + 4.5.3 4.5.14 4.4.16 4.1.5 diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml index a822ade00e7cf..9981ac1ae6f9a 100644 --- a/independent-projects/resteasy-reactive/pom.xml +++ b/independent-projects/resteasy-reactive/pom.xml @@ -61,7 +61,7 @@ 3.2.5 2.5.6 2.1.2 - 4.5.1 + 4.5.3 5.4.0 1.0.0.Final 2.16.1 From 6623f8855b430753be14dd86302842f98d906a63 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 7 Feb 2024 13:42:18 +0200 Subject: [PATCH 06/11] Fix AppCDS generation when using podman We use the same trick as used in native-image building Fixes: #38616 (cherry picked from commit 692a640ffb7d40ae01f094f0cbb6ad1695a7a337) --- .../deployment/pkg/steps/AppCDSBuildStep.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java index c9ca54d8d6262..1b9bb96b800f5 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java @@ -212,11 +212,18 @@ private List dockerRunCommands(OutputTargetBuildItem outputTarget, Strin command.add(outputTarget.getOutputDirectory().toAbsolutePath().toString() + ":" + CONTAINER_IMAGE_BASE_BUILD_DIR + ":z"); if (SystemUtils.IS_OS_LINUX) { - String uid = getLinuxID("-ur"); - String gid = getLinuxID("-gr"); - if (uid != null && gid != null && !uid.isEmpty() && !gid.isEmpty()) { - command.add("--user"); - command.add(uid + ":" + gid); + if (containerRuntime.isDocker() && containerRuntime.isRootless()) { + Collections.addAll(command, "--user", String.valueOf(0)); + } else { + String uid = getLinuxID("-ur"); + String gid = getLinuxID("-gr"); + if (uid != null && gid != null && !uid.isEmpty() && !gid.isEmpty()) { + Collections.addAll(command, "--user", uid + ":" + gid); + if (containerRuntime.isPodman() && containerRuntime.isRootless()) { + // Needed to avoid AccessDeniedExceptions + command.add("--userns=keep-id"); + } + } } } command.add("-w"); From c96c9e2ac8641343c3b58f027bc5024748d69b77 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Tue, 6 Feb 2024 14:45:53 +0000 Subject: [PATCH 07/11] Update SmallRye Config to 3.5.4 (cherry picked from commit 89bd338800db4cef605253cdb66e73d9d1cf8fab) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 3bf07f8fd263d..f59b7f5115ce0 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -51,7 +51,7 @@ 2.0 3.1.1 2.2.0 - 3.5.2 + 3.5.4 4.1.0 4.0.0 3.9.0 From 421f75c52c235e2b900ff354f7c3f704a7fa4fc8 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 7 Feb 2024 10:23:41 +0100 Subject: [PATCH 08/11] Update activemq-artemis-broker container to 1.0.25 And use the same version everywhere. This might help with the CI issues. (cherry picked from commit df6b11f720b04bb499dd5e854ccbc9618fa186f3) --- docs/src/main/asciidoc/amqp.adoc | 2 +- docs/src/main/asciidoc/jms.adoc | 2 +- .../amqp/deployment/AmqpDevServicesBuildTimeConfig.java | 2 +- .../src/main/resources/application.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/amqp.adoc b/docs/src/main/asciidoc/amqp.adoc index d70dd0e501512..17cc76e3268a3 100644 --- a/docs/src/main/asciidoc/amqp.adoc +++ b/docs/src/main/asciidoc/amqp.adoc @@ -372,7 +372,7 @@ version: '2' services: artemis: - image: quay.io/artemiscloud/activemq-artemis-broker:0.1.2 + image: quay.io/artemiscloud/activemq-artemis-broker:1.0.25 ports: - "8161:8161" - "61616:61616" diff --git a/docs/src/main/asciidoc/jms.adoc b/docs/src/main/asciidoc/jms.adoc index c304466b2eae4..08ae9168a8f59 100644 --- a/docs/src/main/asciidoc/jms.adoc +++ b/docs/src/main/asciidoc/jms.adoc @@ -83,7 +83,7 @@ You can follow the instructions from the https://activemq.apache.org/components/ [source,bash] ---- -docker run -it --rm -p 8161:8161 -p 61616:61616 -p 5672:5672 -e AMQ_USER=quarkus -e AMQ_PASSWORD=quarkus quay.io/artemiscloud/activemq-artemis-broker:1.0.21 +docker run -it --rm -p 8161:8161 -p 61616:61616 -p 5672:5672 -e AMQ_USER=quarkus -e AMQ_PASSWORD=quarkus quay.io/artemiscloud/activemq-artemis-broker:1.0.25 ---- === The price producer diff --git a/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesBuildTimeConfig.java b/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesBuildTimeConfig.java index 9e21d4b3c54b3..2f350c93139ee 100644 --- a/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesBuildTimeConfig.java +++ b/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesBuildTimeConfig.java @@ -35,7 +35,7 @@ public class AmqpDevServicesBuildTimeConfig { * page * to find the available versions. */ - @ConfigItem(defaultValue = "quay.io/artemiscloud/activemq-artemis-broker:1.0.22") + @ConfigItem(defaultValue = "quay.io/artemiscloud/activemq-artemis-broker:1.0.25") public String imageName; /** diff --git a/integration-tests/virtual-threads/jms-virtual-threads/src/main/resources/application.properties b/integration-tests/virtual-threads/jms-virtual-threads/src/main/resources/application.properties index 57d7613b5e8e5..fd8aab5e2348f 100644 --- a/integration-tests/virtual-threads/jms-virtual-threads/src/main/resources/application.properties +++ b/integration-tests/virtual-threads/jms-virtual-threads/src/main/resources/application.properties @@ -5,4 +5,4 @@ mp.messaging.outgoing.prices-out.destination=prices smallrye.messaging.worker..max-concurrency=5 quarkus.artemis.devservices.enabled=true -quarkus.artemis.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:1.0.18 +quarkus.artemis.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:1.0.25 From 09337f5596c2b16ffb2c6b53fcc66ae221f5bc0e Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 7 Feb 2024 14:07:16 +0100 Subject: [PATCH 09/11] Use [[anchor]] format consistently (cherry picked from commit a309b306937f98108d33fbe953d46fdfb14244d7) --- docs/src/main/asciidoc/amqp-reference.adoc | 2 +- .../main/asciidoc/azure-functions-http.adoc | 2 +- .../main/asciidoc/building-native-image.adoc | 6 +++--- docs/src/main/asciidoc/cache.adoc | 8 ++++---- docs/src/main/asciidoc/container-image.adoc | 10 +++++----- .../main/asciidoc/deploying-to-kubernetes.adoc | 10 +++++----- .../main/asciidoc/deploying-to-openshift.adoc | 6 +++--- docs/src/main/asciidoc/dev-ui.adoc | 2 +- .../src/main/asciidoc/extension-codestart.adoc | 18 +++++++++--------- .../main/asciidoc/extension-registry-user.adoc | 2 +- .../main/asciidoc/getting-started-testing.adoc | 4 ++-- docs/src/main/asciidoc/getting-started.adoc | 2 +- .../asciidoc/infinispan-client-reference.adoc | 2 +- docs/src/main/asciidoc/jms.adoc | 8 ++++---- docs/src/main/asciidoc/kafka.adoc | 6 +++--- docs/src/main/asciidoc/kubernetes-client.adoc | 4 ++-- docs/src/main/asciidoc/logging.adoc | 4 ++-- docs/src/main/asciidoc/mailer-reference.adoc | 2 +- docs/src/main/asciidoc/native-and-ssl.adoc | 4 ++-- .../quarkus-reactive-architecture.adoc | 4 ++-- docs/src/main/asciidoc/rabbitmq-reference.adoc | 2 +- .../main/asciidoc/rest-client-reactive.adoc | 6 +++--- docs/src/main/asciidoc/resteasy-client.adoc | 2 +- docs/src/main/asciidoc/resteasy-reactive.adoc | 2 +- .../src/main/asciidoc/scheduler-reference.adoc | 2 +- docs/src/main/asciidoc/scheduler.adoc | 2 +- .../security-authentication-mechanisms.adoc | 4 ++-- .../src/main/asciidoc/security-properties.adoc | 6 +++--- docs/src/main/asciidoc/security-testing.adoc | 2 +- docs/src/main/asciidoc/spring-security.adoc | 2 +- docs/src/main/asciidoc/vertx-reference.adoc | 12 ++++++------ .../writing-native-applications-tips.adoc | 2 +- 32 files changed, 75 insertions(+), 75 deletions(-) diff --git a/docs/src/main/asciidoc/amqp-reference.adoc b/docs/src/main/asciidoc/amqp-reference.adoc index 44aa061a1958f..85355b4b98e0d 100644 --- a/docs/src/main/asciidoc/amqp-reference.adoc +++ b/docs/src/main/asciidoc/amqp-reference.adoc @@ -369,7 +369,7 @@ mp.messaging.incoming.people-out.link-name=people More details about the AMQP Address model can be found in the https://activemq.apache.org/components/artemis/documentation/2.0.0/address-model.html[Artemis documentation]. -[#blocking-processing] +[[blocking-processing]] === Execution model and Blocking processing Reactive Messaging invokes your method on an I/O thread. diff --git a/docs/src/main/asciidoc/azure-functions-http.adoc b/docs/src/main/asciidoc/azure-functions-http.adoc index a02be3bfb5bd6..1affe1b2bbdd6 100644 --- a/docs/src/main/asciidoc/azure-functions-http.adoc +++ b/docs/src/main/asciidoc/azure-functions-http.adoc @@ -85,7 +85,7 @@ The Azure Functions `host.json` deployment descriptor is automatically generated, but if you need to override it, declare it in the root directory of the project and rerun the build when you are ready. -[#config-azure-paths] +[[config-azure-paths]] == Configuring Root Paths The default route prefix for an Azure Function is `/api`. All of your Jakarta REST, Servlet, Reactive Routes, and xref:funqy-http.adoc[Funqy HTTP] endpoints must diff --git a/docs/src/main/asciidoc/building-native-image.adoc b/docs/src/main/asciidoc/building-native-image.adoc index 6e3712384afd5..f2f79557e668f 100644 --- a/docs/src/main/asciidoc/building-native-image.adoc +++ b/docs/src/main/asciidoc/building-native-image.adoc @@ -379,7 +379,7 @@ It is also possible to re-run the tests against a native executable that has alr If the process cannot find the native image for some reason, or you want to test a native image that is no longer in the target directory you can specify the executable with the `-Dnative.image.path=` system property. -[#container-runtime] +[[container-runtime]] == Creating a Linux executable without GraalVM installed IMPORTANT: Before going further, be sure to have a working container runtime (Docker, podman) environment. If you use Docker @@ -415,7 +415,7 @@ These are regular Quarkus config properties, so if you always want to build in a it is recommended you add these to your `application.properties` in order to avoid specifying them every time. ==== -[#tip-quarkus-native-remote-container-build] +[[tip-quarkus-native-remote-container-build]] [TIP] ==== If you see the following invalid path error for your application JAR when trying to create a native executable using a container build, even though your JAR was built successfully, you're most likely using a remote daemon for your container runtime. @@ -548,7 +548,7 @@ CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] The UBI minimal image is bigger than the micro one mentioned above. It contains more utilities such as the `microdnf` package manager. -[#multistage-docker] +[[multistage-docker]] === Using a multi-stage Docker build The previous section showed you how to build a native executable using Maven or Gradle, but it requires you to have created the native executable first. diff --git a/docs/src/main/asciidoc/cache.adoc b/docs/src/main/asciidoc/cache.adoc index 83ddd47318cb9..af3ebc278725a 100644 --- a/docs/src/main/asciidoc/cache.adoc +++ b/docs/src/main/asciidoc/cache.adoc @@ -273,7 +273,7 @@ Congratulations! You just added application data caching to your Quarkus applica Do you want to learn more about the Quarkus application data caching abilities? The following sections will show you everything there is to know about it. -[#annotations-api] +[[annotations-api]] == Caching using annotations Quarkus offers a set of annotations that can be used in a CDI managed bean to enable caching abilities. @@ -327,7 +327,7 @@ method annotated with `@CacheResult` or `@CacheInvalidate`. This annotation is optional and should only be used when some method arguments are NOT part of the cache key. -[#cache-keys-building-logic] +[[cache-keys-building-logic]] === Cache keys building logic Cache keys are built by the annotations API using the following logic: @@ -489,7 +489,7 @@ public class CachedService { <3> This key generator is not a CDI bean. <4> The `@CacheKey` annotation will be ignored when the `foo` cache data is invalidated, but `param1` will be the cache key when the `bar` cache data is invalidated. -[#programmatic-api] +[[programmatic-api]] == Caching using the programmatic API Quarkus also offers a programmatic API which can be used to store, retrieve or delete values from any cache declared using the annotations API. @@ -966,7 +966,7 @@ public class CacheClearer { } ---- -[#negative-cache] +[[negative-cache]] == Negative caching and nulls Sometimes one wants to cache the result of an (expensive) remote call. diff --git a/docs/src/main/asciidoc/container-image.adoc b/docs/src/main/asciidoc/container-image.adoc index 2fd411e028c52..2ec5a802577ca 100644 --- a/docs/src/main/asciidoc/container-image.adoc +++ b/docs/src/main/asciidoc/container-image.adoc @@ -19,7 +19,7 @@ Quarkus provides extensions for building (and pushing) container images. Current == Container Image extensions -[#jib] +[[jib]] === Jib The extension `quarkus-container-image-jib` is powered by https://github.com/GoogleContainerTools/jib[Jib] for performing container image builds. @@ -106,7 +106,7 @@ this property needs to be known very early on in the build process. Quarkus supports generating and including an link:https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#application-class-data-sharing[Application Class Data Sharing] archive when generating a container image using Jib. See the xref:appcds.adoc[AppCDS documentation] for more details. -[#docker] +[[docker]] === Docker The extension `quarkus-container-image-docker` is using the Docker binary and the generated Dockerfiles under `src/main/docker` in order to perform Docker builds. @@ -120,7 +120,7 @@ The `quarkus-container-image-docker` extension is capable of https://docs.docker 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.buildx.platform` property, the resulting images will not be loaded into `docker images`. If `quarkus.docker.buildx.platform` is omitted or if only a single platform is specified, it will then be loaded into `docker images`. -[#openshift] +[[openshift]] === OpenShift The extension `quarkus-container-image-openshift` is using OpenShift binary builds in order to perform container builds inside the OpenShift cluster. @@ -137,7 +137,7 @@ OpenShift builds require creating a `BuildConfig` and two `ImageStream` resource The creation of such objects is being taken care of by the Quarkus Kubernetes extension. -[#buildpack] +[[buildpack]] === Buildpack The extension `quarkus-container-image-buildpack` is using buildpacks in order to perform container image builds. @@ -248,7 +248,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] +[[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/deploying-to-kubernetes.adoc b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc index 382e724a36d14..7ad56e3a51c86 100644 --- a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc +++ b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc @@ -22,7 +22,7 @@ Finally, when either one of container image extensions is present (see the xref: include::{includes}/prerequisites.adoc[] * Access to a Kubernetes cluster (Minikube is a viable option) -[#kubernetes] +[[kubernetes]] == Kubernetes Let's create a new project that contains both the Kubernetes and Jib extensions: @@ -400,7 +400,7 @@ quarkus.kubernetes.annotations.foo=bar quarkus.kubernetes.annotations."app.quarkus/id"=42 ---- -[#env-vars] +[[env-vars]] ==== Environment variables Kubernetes provides multiple ways of defining environment variables: @@ -538,7 +538,7 @@ A conflict between two definitions, e.g. mistakenly assigning both a value and s Similarly, two redundant definitions, e.g. defining an injection from the same secret twice, will not cause an issue but will indeed report a warning to let you know that you might not have intended to duplicate that definition. -[#env-vars-backwards] +[[env-vars-backwards]] ===== Backwards compatibility Previous versions of the Kubernetes extension supported a different syntax to add environment variables. The older syntax is still supported but is deprecated, and it's advised that you migrate to the new syntax. @@ -1084,7 +1084,7 @@ The full list of the Kubernetes client configuration properties is provided belo :no-duration-note: true include::{generated-dir}/config/quarkus-kubernetes-client.adoc[opts=optional, leveloffset=+1] -[#openshift] +[[openshift]] === OpenShift One way to deploy an application to OpenShift is to use s2i (source to image) to create an image stream from the source and then deploy the image stream: @@ -1195,7 +1195,7 @@ The OpenShift resources can be customized in a similar approach with Kubernetes. :no-duration-note: true include::{generated-dir}/config/quarkus-openshift-openshift-config.adoc[opts=optional, leveloffset=+1] -[#knative] +[[knative]] === Knative To enable the generation of Knative resources, you need to include Knative in the target platforms: diff --git a/docs/src/main/asciidoc/deploying-to-openshift.adoc b/docs/src/main/asciidoc/deploying-to-openshift.adoc index 57a53873faf38..b1a50d3aba7b6 100644 --- a/docs/src/main/asciidoc/deploying-to-openshift.adoc +++ b/docs/src/main/asciidoc/deploying-to-openshift.adoc @@ -92,7 +92,7 @@ include::{includes}/devtools/build.adoc[] TIP: If you want to test your application immediately then set the `quarkus.openshift.route.expose` config property to `true` to <>, e.g. add `-Dquarkus.openshift.route.expose=true` to the command above. -[#re-deploy-with-service-binding] +[[re-deploy-with-service-binding]] NOTE: When using `DeploymentConfig` and xref:deploying-to-kubernetes.adoc#service_binding[Service Binding], re-deploying might remove the configuration added by OpenShift to allow service discovery. A new container image build will trigger a refresh of the Quarkus app in OpenShift: `-Dquarkus.container-image.build=true` which might be enough in most situations. If you need to update the OpenShift resources, you need to delete the binding first to create it again after new deployment. This command will build your application locally, then trigger a container image build and finally apply the generated OpenShift resources automatically. @@ -273,7 +273,7 @@ To add an annotation in the generated resources: quarkus.openshift.annotations.foo=bar ---- -[#env-vars] +[[env-vars]] === Environment variables OpenShift provides multiple ways of defining environment variables: @@ -440,7 +440,7 @@ A conflict between two definitions, e.g. mistakenly assigning both a value and s Similarly, two redundant definitions, e.g. defining an injection from the same secret twice, will not cause an issue but will indeed report a warning to let you know that you might not have intended to duplicate that definition. -[#env-vars-backwards] +[[env-vars-backwards]] ===== Backwards compatibility Previous versions of the OpenShift extension supported a different syntax to add environment variables. The older syntax is still supported but is deprecated, and it's advised that you migrate to the new syntax. diff --git a/docs/src/main/asciidoc/dev-ui.adoc b/docs/src/main/asciidoc/dev-ui.adoc index 38bcbb28de722..42454fba55d29 100644 --- a/docs/src/main/asciidoc/dev-ui.adoc +++ b/docs/src/main/asciidoc/dev-ui.adoc @@ -841,7 +841,7 @@ The router is mostly used internally. This uses https://github.com/vaadin/router See the https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/controller/router-controller.js[controller] for some methods that might be useful. -[#JsonRPC] +[[JsonRPC]] ====== JsonRPC This controller allows you to fetch or stream runtime data. (vs. <> discussed earlier). There are two parts to getting data during runtime. The Java side in the runtime module, and then the usage in the web component. diff --git a/docs/src/main/asciidoc/extension-codestart.adoc b/docs/src/main/asciidoc/extension-codestart.adoc index 5f36ce736aa24..509addfa1107a 100644 --- a/docs/src/main/asciidoc/extension-codestart.adoc +++ b/docs/src/main/asciidoc/extension-codestart.adoc @@ -347,14 +347,14 @@ public class ConfigYamlCodestartTest { == Specific topics -[#org-acme-package] +[[org-acme-package]] === `org.acme` placeholder for package name You have to use `org.acme` as the package name in your extension codestart sources. In the generated project, the user specified package (or Group) will be used (and automatically replace `org.acme`). The package will be automatically replaced in all the source files (.java, .kt, .scala). The package directory will also be automatically adjusted. If for some reason, another type of file needs the user package name then you should use a <> for it and the `{project.package-name}` data placeholder (https://github.com/quarkusio/quarkus/blob/main/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/grpc-codestart/base/src/main/proto/hello.tpl.qute.proto#L4[find an example in the grpc proto file, window="_blank"]). -[#codestart-yml] +[[codestart-yml]] === codestart.yml [source,yaml] @@ -376,7 +376,7 @@ metadata: path: /some-path ---- -[#directory-structure] +[[directory-structure]] === Directory Structure NOTE: `codestart.yml` is the only required file. @@ -428,7 +428,7 @@ maven-surefire-plugin.version = Maven Surefire plugin version * certain common files, such as `readme.md`, `src/main/resources/application.yml`, `src/main/resources/META-INF/resources/index.html` are generated from the collected fragments found in the selected codestarts for the project * other files are copied. -[#qute-templates] +[[qute-templates]] === Templates (Qute) Codestarts may use Qute templates `MyClass.tpl.qute.java` for dynamic rendering. @@ -440,7 +440,7 @@ Those templates are able to use data which contains: * The user input * Some dynamically generated data (e.g. `dependencies` and `test-dependencies`) -[#readme-md] +[[readme-md]] === README.md You may add a `README.md` or `README.tpl.qute.md` in the `base` directory, it will be appended to the others. @@ -456,7 +456,7 @@ base/README.tpl.qute.md NOTE: The `{#include readme-header /}` will use a template located in the Quarkus project codestart which displays standard info from the `codestart.yml` metadata. -[#app-config] +[[app-config]] === application config application.yml As a convention, you should always provide the Quarkus configuration as a yaml file (`base/src/main/resources/application.yml`). @@ -466,7 +466,7 @@ It is going to be: * merged with the other extension codestarts configs * automatically converted to the selected config type (yaml or properties) at generation time depending on the selected extensions -[#index-html] +[[index-html]] === index.html and web extension codestarts Extension codestarts may provide a snippet for the generated index.html by adding this file: @@ -479,7 +479,7 @@ base/src/main/resources/META-INF/resources/index.entry.qute.html: NOTE: The `{#include index-entry /}` will use a template located in the Quarkus project codestart which displays standard info from the `codestart.yml` metadata. -[#integration-test] +[[integration-test]] === Integration test An extension is available to help test extension codestarts `QuarkusCodestartTest`: @@ -504,7 +504,7 @@ The extension provides helpers to test that the projects build `buildAllProjects The https://github.com/quarkusio/quarkus/blob/main/integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/quarkus/ConfigYamlCodestartTest.java[ ConfigYamlCodestartTest, window="_blank"] is a good example in Quarkus core. -[#snapshot-testing] +[[snapshot-testing]] ==== Snapshot testing Snapshot testing is a way to make sure the content generated by a test doesn't change from one revision to another, i.e. between commits. That means, the generated content for each commit needs to be immutable and deterministic (this is the reason for using mocked data). To be able to perform such checks, we auto-generate snapshots of the generated content and commit them as the references of the expected output for subsequent test runs. When the templates change, we also commit the induced snapshots changes. This way, during the review, we can make sure the applied code changes have the expected effects on the generated output. diff --git a/docs/src/main/asciidoc/extension-registry-user.adoc b/docs/src/main/asciidoc/extension-registry-user.adoc index 9d0663d436649..7e749b2554d8b 100644 --- a/docs/src/main/asciidoc/extension-registry-user.adoc +++ b/docs/src/main/asciidoc/extension-registry-user.adoc @@ -182,7 +182,7 @@ Some options need to be set: Here is an example on how it should look like: -[#img-nexus] +[[img-nexus]] .Nexus Repository Manager: Add Proxy Repository image:registry-nexus-repository.png[Nexus Repository Proxy] diff --git a/docs/src/main/asciidoc/getting-started-testing.adoc b/docs/src/main/asciidoc/getting-started-testing.adoc index 61eba1e3bb8fb..9ae069a0b0235 100644 --- a/docs/src/main/asciidoc/getting-started-testing.adoc +++ b/docs/src/main/asciidoc/getting-started-testing.adoc @@ -1070,7 +1070,7 @@ If you are using the `quarkus-hibernate-orm-panache` or `quarkus-mongodb-panache If you are using Quarkus Security, check out the xref:security-testing.adoc[Testing Security] section for information on how to easily test security features of the application. -[#quarkus-test-resource] +[[quarkus-test-resource]] == Starting services before the Quarkus application starts A very common need is to start some services on which your Quarkus application depends, before the Quarkus application starts for testing. To address this need, Quarkus provides `@io.quarkus.test.common.QuarkusTestResource` and `io.quarkus.test.common.QuarkusTestResourceLifecycleManager`. @@ -1242,7 +1242,7 @@ guide except injecting into tests (and the native executable runs in a separate This is covered in the xref:building-native-image.adoc[Native Executable Guide]. -[#quarkus-integration-test] +[[quarkus-integration-test]] == Using `@QuarkusIntegrationTest` `@QuarkusIntegrationTest` should be used to launch and test the artifact produced by the Quarkus build, and supports testing a jar (of whichever type), a native image or container image. diff --git a/docs/src/main/asciidoc/getting-started.adoc b/docs/src/main/asciidoc/getting-started.adoc index cb48c24485267..6c4a754220020 100644 --- a/docs/src/main/asciidoc/getting-started.adoc +++ b/docs/src/main/asciidoc/getting-started.adoc @@ -456,7 +456,7 @@ NOTE: If you want to deploy your application somewhere (typically in a container NOTE: Before running the application, don't forget to stop the hot reload mode (hit `CTRL+C`), or you will have a port conflict. -[#banner] +[[banner]] == Configuring the banner By default, when a Quarkus application starts (in regular or dev mode), it will display an ASCII art banner. The banner can be disabled by setting `quarkus.banner.enabled=false` in `application.properties`, diff --git a/docs/src/main/asciidoc/infinispan-client-reference.adoc b/docs/src/main/asciidoc/infinispan-client-reference.adoc index 22674f6f605b4..95eeaa62fba44 100644 --- a/docs/src/main/asciidoc/infinispan-client-reference.adoc +++ b/docs/src/main/asciidoc/infinispan-client-reference.adoc @@ -666,7 +666,7 @@ for Kubernetes deployments, Infinispan Console, https://infinispan.org/docs/stable/titles/rest/rest.html#rest_v2_protobuf_schemas[REST API] or the https://infinispan.org/docs/stable/titles/encoding/encoding.html#registering-sci-remote-caches_marshalling[Hot Rod Java Client]. -[#infinispan-annotations-api] +[[infinispan-annotations-api]] == Caching using annotations The Infinispan Client extension offers a set of annotations that can be used in a CDI managed bean to enable caching abilities with Infinispan. diff --git a/docs/src/main/asciidoc/jms.adoc b/docs/src/main/asciidoc/jms.adoc index 08ae9168a8f59..76eb8d70649ef 100644 --- a/docs/src/main/asciidoc/jms.adoc +++ b/docs/src/main/asciidoc/jms.adoc @@ -33,7 +33,7 @@ The guide can be used either via the Apache Qpid JMS AMQP client as detailed imm alternatively with the Apache ActiveMQ Artemis JMS client given some different configuration as <>. -[#qpid-jms-amqp] +[[qpid-jms-amqp]] == Qpid JMS - AMQP In the detailed steps below we will use the https://qpid.apache.org/components/jms/[Apache Qpid JMS] @@ -75,7 +75,7 @@ This command generates a new project importing the quarkus-qpid-jms extension: implementation("org.amqphub.quarkus:quarkus-qpid-jms") ---- -[#starting-the-broker] +[[starting-the-broker]] === Starting the broker Then, we need an AMQP broker. In this case we will use an Apache ActiveMQ Artemis server. @@ -294,7 +294,7 @@ quarkus.qpid-jms.password=quarkus More detail about the configuration are available in the https://github.com/amqphub/quarkus-qpid-jms#configuration[Quarkus Qpid JMS] documentation. -[#get-it-running] +[[get-it-running]] === Get it running If you followed the instructions, you should have the Artemis server running. @@ -326,7 +326,7 @@ Open `http://localhost:8080/prices.html` in your browser. ''' -[#artemis-jms] +[[artemis-jms]] == Artemis JMS The above steps detailed using the Qpid JMS AMQP client, however the guide can also be used diff --git a/docs/src/main/asciidoc/kafka.adoc b/docs/src/main/asciidoc/kafka.adoc index a1eebb82de887..120a2977b7e52 100644 --- a/docs/src/main/asciidoc/kafka.adoc +++ b/docs/src/main/asciidoc/kafka.adoc @@ -237,7 +237,7 @@ Injecting `@Channel("prices")` or having `@Incoming("prices")` does not automati You need to configure an inbound connector with `mp.messaging.incoming.prices\...` or have an `@Outgoing("prices")` method somewhere in your application (in which case, `prices` will be an in-memory channel). ==== -[#blocking-processing] +[[blocking-processing]] === Blocking processing Reactive Messaging invokes your method on an I/O thread. @@ -2775,7 +2775,7 @@ mp.messaging.incoming.fruits.value.deserializer=org.acme.FruitDeserializer Check <> for more detail about the usage of Jackson with Kafka. You can also use Avro. -[#persisting-kafka-messages-with-hibernate-reactive] +[[persisting-kafka-messages-with-hibernate-reactive]] === Persisting Kafka messages with Hibernate Reactive To persist objects received from Kafka into a database, you can use Hibernate Reactive with Panache. @@ -2922,7 +2922,7 @@ public class ResourceSendingToKafka { <3> Wrap the managed entity inside a Data transfer object and send it to Kafka. This makes sure that managed entity is not impacted by the Kafka serialization. -[#writing-entities-managed-by-hibernate-reactive-to-kafka] +[[writing-entities-managed-by-hibernate-reactive-to-kafka]] === Writing entities managed by Hibernate Reactive to Kafka To send to Kafka entities managed by Hibernate Reactive, we recommend using: diff --git a/docs/src/main/asciidoc/kubernetes-client.adoc b/docs/src/main/asciidoc/kubernetes-client.adoc index 23a5efce9e567..19f5be0fc7ca4 100644 --- a/docs/src/main/asciidoc/kubernetes-client.adoc +++ b/docs/src/main/asciidoc/kubernetes-client.adoc @@ -286,7 +286,7 @@ public class KubernetesClientTest { } ---- -[#note-on-generic-types] +[[note-on-generic-types]] == Note on implementing or extending generic types Due to the restrictions imposed by GraalVM, extra care needs to be taken when implementing or extending generic types provided by the client if the application is intended to work in native mode. @@ -369,7 +369,7 @@ public class ResourceWatcher implements Watcher { client.pods().watch(new ResourceWatcher()); ---- -[#note-on-ec-keys] +[[note-on-ec-keys]] == Note on using Elliptic Curve keys Please note that if you would like to use Elliptic Curve keys with Kubernetes Client then adding a BouncyCastle PKIX dependency is required: diff --git a/docs/src/main/asciidoc/logging.adoc b/docs/src/main/asciidoc/logging.adoc index 9d93ff634e73f..0f6ab858131f0 100644 --- a/docs/src/main/asciidoc/logging.adoc +++ b/docs/src/main/asciidoc/logging.adoc @@ -585,7 +585,7 @@ quarkus.log.category."io.undertow.request.security".level=TRACE NOTE: As we don't change the root logger, the console log will only contain `INFO` or higher level logs. -[#category-named-handlers-example] +[[category-named-handlers-example]] .Named handlers attached to a category [source, properties] ---- @@ -602,7 +602,7 @@ quarkus.log.category."io.quarkus.category".level=INFO quarkus.log.category."io.quarkus.category".handlers=STRUCTURED_LOGGING,STRUCTURED_LOGGING_FILE ---- -[#root-category-named-handlers-example] +[[root-category-named-handlers-example]] .Named handlers attached to the root logger [source, properties] ---- diff --git a/docs/src/main/asciidoc/mailer-reference.adoc b/docs/src/main/asciidoc/mailer-reference.adoc index 82b0254667905..ce3ed5b03802c 100644 --- a/docs/src/main/asciidoc/mailer-reference.adoc +++ b/docs/src/main/asciidoc/mailer-reference.adoc @@ -461,7 +461,7 @@ Use `MailTemplate` injection for the named mailer configurations. This section provides the configurations to use with popular mail services. -[#gmail-specific-configuration] +[[gmail-specific-configuration]] === Gmail specific configuration If you want to use the Gmail SMTP server, first create a dedicated password in `Google Account > Security > App passwords` or go to https://myaccount.google.com/apppasswords. diff --git a/docs/src/main/asciidoc/native-and-ssl.adoc b/docs/src/main/asciidoc/native-and-ssl.adoc index 95511651bacfe..142c5aedd3101 100644 --- a/docs/src/main/asciidoc/native-and-ssl.adoc +++ b/docs/src/main/asciidoc/native-and-ssl.adoc @@ -214,7 +214,7 @@ And let's build the native executable again: include::{includes}/devtools/build-native.adoc[] -[#the-truststore-path] +[[the-truststore-path]] == The TrustStore path [WARNING] @@ -257,7 +257,7 @@ The file containing the custom TrustStore does *not* (and probably should not) h Using the runtime certificate configuration, supported by GraalVM since 21.3 does not require any special or additional configuration compared to regular java programs or Quarkus in jvm mode. For more information, see the link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/dynamic-features/CertificateManagement/#runtime-options[Runtime Options] section of the "GraalVM Certificate Management in Native Image" guide. -[#working-with-containers] +[[working-with-containers]] === Working with containers No special action needs to be taken when running the native binary in a container. If the native binary was properly built with the custom TrustStore diff --git a/docs/src/main/asciidoc/quarkus-reactive-architecture.adoc b/docs/src/main/asciidoc/quarkus-reactive-architecture.adoc index 5a35c153f49da..8e1056f21fee0 100644 --- a/docs/src/main/asciidoc/quarkus-reactive-architecture.adoc +++ b/docs/src/main/asciidoc/quarkus-reactive-architecture.adoc @@ -153,7 +153,7 @@ Quarkus is pragmatic and versatile. You decide how to develop and execute your application. You can use the imperative way, the reactive way, or mix them, using reactive on the parts of the application under high concurrency. -[#quarkus-extensions-enabling-reactive] +[[quarkus-extensions-enabling-reactive]] == Quarkus Extensions enabling Reactive Quarkus offers a large set of reactive APIs and features. @@ -193,7 +193,7 @@ Offer reactive and imperative programming interfaces. * GraphQL: implement and query (client) data store using GraphQL. Offers Mutiny APIs and subscriptions as event streams. * Fault Tolerance: provide retry, fallback, circuit breakers abilities to your application.It can be used with Mutiny types. -[#engine] +[[engine]] === Engine * Vert.x : the underlying reactive engine of Quarkus. diff --git a/docs/src/main/asciidoc/rabbitmq-reference.adoc b/docs/src/main/asciidoc/rabbitmq-reference.adoc index d264e5aa97e47..f8d2bda05b14e 100644 --- a/docs/src/main/asciidoc/rabbitmq-reference.adoc +++ b/docs/src/main/asciidoc/rabbitmq-reference.adoc @@ -294,7 +294,7 @@ mp.messaging.outgoing.people.exchange.name=people mp.messaging.outgoing.people.exchange.declare=false ---- -[#blocking-processing] +[[blocking-processing]] === Execution model and Blocking processing Reactive Messaging invokes your method on an I/O thread. diff --git a/docs/src/main/asciidoc/rest-client-reactive.adoc b/docs/src/main/asciidoc/rest-client-reactive.adoc index d704cea4f9362..5fd3900294189 100644 --- a/docs/src/main/asciidoc/rest-client-reactive.adoc +++ b/docs/src/main/asciidoc/rest-client-reactive.adoc @@ -681,7 +681,7 @@ public class ExtensionsResource { <1> the client will use the registered HTTP Client options over the HTTP Client options provided via CDI if any. -[#redirection] +[[redirection]] == Redirection A HTTP server can redirect a response to another location by sending a response with a status code that starts with "3" and a HTTP header "Location" holding the URL to be redirected to. When the REST Client receives a redirection response from a HTTP server, it won't automatically perform another request to the new location. We can enable the automatic redirection in REST Client by adding the "follow-redirects" property: @@ -808,7 +808,7 @@ public class ExtensionsResourceTest { The code above uses link:https://rest-assured.io/[REST Assured]'s link:https://github.com/rest-assured/rest-assured/wiki/GettingStarted#jsonpath[json-path] capabilities. -[#async-support] +[[async-support]] == Async Support To get the full power of the reactive nature of the client, you can use the non-blocking flavor of REST Client Reactive extension, @@ -1785,7 +1785,7 @@ public class QuarkusMockTest { <2> note that `RestClient.LITERAL` has to be passed as the last argument of the `installMockForType` method -[#using-a-mock-http-server-for-tests] +[[using-a-mock-http-server-for-tests]] == Using a Mock HTTP Server for tests Setting up a mock HTTP server, against which tests are run, is a common testing pattern. diff --git a/docs/src/main/asciidoc/resteasy-client.adoc b/docs/src/main/asciidoc/resteasy-client.adoc index 3d04e1f1d84a7..912a70ea3b7f7 100644 --- a/docs/src/main/asciidoc/resteasy-client.adoc +++ b/docs/src/main/asciidoc/resteasy-client.adoc @@ -341,7 +341,7 @@ public class ExtensionsResourceTest { The code above uses link:https://rest-assured.io/[REST Assured]'s link:https://github.com/rest-assured/rest-assured/wiki/GettingStarted#jsonpath[json-path] capabilities. -[#redirection] +[[redirection]] == Redirection A HTTP server can redirect a response to another location by sending a response with a status code that starts with "3" and a HTTP header "Location" holding the URL to be redirected to. When the REST Client receives a redirection response from a HTTP server, it won't automatically perform another request to the new location. However, you can enable the automatic redirection by enabling the "follow-redirects" property: diff --git a/docs/src/main/asciidoc/resteasy-reactive.adoc b/docs/src/main/asciidoc/resteasy-reactive.adoc index c5f77edcd6eb4..52278efc7003c 100644 --- a/docs/src/main/asciidoc/resteasy-reactive.adoc +++ b/docs/src/main/asciidoc/resteasy-reactive.adoc @@ -1917,7 +1917,7 @@ For more information about the CORS filters and their usage, see the xref:securi Here are some more advanced topics that you may not need to know about initially, but could prove useful for more complex use cases. -[#execution-model-blocking-non-blocking] +[[execution-model-blocking-non-blocking]] === Execution model, blocking, non-blocking [[execution-model]] diff --git a/docs/src/main/asciidoc/scheduler-reference.adoc b/docs/src/main/asciidoc/scheduler-reference.adoc index d4cb1cc0f02a9..25fa988a58315 100644 --- a/docs/src/main/asciidoc/scheduler-reference.adoc +++ b/docs/src/main/asciidoc/scheduler-reference.adoc @@ -166,7 +166,7 @@ So for example a Property Expression with the default value `"off"` can be used void myMethod() { } ---- -[#identity] +[[identity]] === Identity By default, a unique identifier is generated for each scheduled method. diff --git a/docs/src/main/asciidoc/scheduler.adoc b/docs/src/main/asciidoc/scheduler.adoc index b402f01251292..6fdd25396e772 100644 --- a/docs/src/main/asciidoc/scheduler.adoc +++ b/docs/src/main/asciidoc/scheduler.adoc @@ -74,7 +74,7 @@ This will add the following to your build file: implementation("io.quarkus:quarkus-scheduler") ---- -[#standard-scheduling] +[[standard-scheduling]] == Creating a scheduled job In the `org.acme.scheduler` package, create the `CounterBean` class, with the following content: diff --git a/docs/src/main/asciidoc/security-authentication-mechanisms.adoc b/docs/src/main/asciidoc/security-authentication-mechanisms.adoc index dd3f8522251c7..76bfeb30693fc 100644 --- a/docs/src/main/asciidoc/security-authentication-mechanisms.adoc +++ b/docs/src/main/asciidoc/security-authentication-mechanisms.adoc @@ -207,7 +207,7 @@ When you set `quarkus.http.ssl.client-auth` to `required`, the system automatica When the incoming request matches a valid certificate in the truststore, your application can obtain the subject by injecting a `SecurityIdentity` as follows: -[#x509-subject-example] +[[x509-subject-example]] .Obtaining the subject [source,java] ---- @@ -222,7 +222,7 @@ public String hello() { ---- You can also get the certificate by using the code outlined in the following example: -[#x509-credential-example] +[[x509-credential-example]] .Obtaining the certificate [source,java] ---- diff --git a/docs/src/main/asciidoc/security-properties.adoc b/docs/src/main/asciidoc/security-properties.adoc index dc6d3d36a78d1..d2916c7a862f3 100644 --- a/docs/src/main/asciidoc/security-properties.adoc +++ b/docs/src/main/asciidoc/security-properties.adoc @@ -61,7 +61,7 @@ The `quarkus.security.users.file.users` configuration property specifies a class The following <> illustrates the format: -[#test-users-example] +[[test-users-example]] .Example of `test-users.properties` [source,properties] ---- @@ -121,7 +121,7 @@ This can be generated for the first example above by running the command `echo - The user to password mappings are specified in the `application.properties` file by properties keys of the form `quarkus.security.users.embedded.users.=`. The following <> illustrates the syntax with 4 user-to-password mappings: -[#password-example] +[[password-example]] .Example of passwords [source,properties,linenums] ---- @@ -138,7 +138,7 @@ quarkus.security.users.embedded.users.noadmin=n0Adm1n The user to role mappings are specified in the `application.properties` file by properties keys of the form `quarkus.security.users.embedded.roles.=role1[,role2[,role3[,...]]]`. The following <> illustrates the syntax with 4 user-to-role mappings: -[#roles-example] +[[roles-example]] .Example of roles [source,properties,linenums] ---- diff --git a/docs/src/main/asciidoc/security-testing.adoc b/docs/src/main/asciidoc/security-testing.adoc index 234bc9d736d37..382087d19aa46 100644 --- a/docs/src/main/asciidoc/security-testing.adoc +++ b/docs/src/main/asciidoc/security-testing.adoc @@ -36,7 +36,7 @@ quarkus.oauth2.client-secret=client-secret quarkus.oauth2.introspection-url=http://host:port/introspect ---- -[#testing-security] +[[testing-security]] == Test Security Extension Quarkus provides explicit support for testing with different users, and with the security subsystem disabled. To use diff --git a/docs/src/main/asciidoc/spring-security.adoc b/docs/src/main/asciidoc/spring-security.adoc index 1b256ee98d88d..a92cecd6afee8 100644 --- a/docs/src/main/asciidoc/spring-security.adoc +++ b/docs/src/main/asciidoc/spring-security.adoc @@ -142,7 +142,7 @@ Open your browser to http://localhost:8080/greeting. The result should be: `{"message": "hello"}`. -[#secure] +[[secure]] == Modify the controller to secure the `hello` method In order to restrict access to the `hello` method to users with certain roles, the `@Secured` annotation will be utilized. diff --git a/docs/src/main/asciidoc/vertx-reference.adoc b/docs/src/main/asciidoc/vertx-reference.adoc index 5802a913f61dd..b7956de6f443b 100644 --- a/docs/src/main/asciidoc/vertx-reference.adoc +++ b/docs/src/main/asciidoc/vertx-reference.adoc @@ -15,7 +15,7 @@ As described in the xref:quarkus-reactive-architecture.adoc[Quarkus Reactive Arc This guide is the companion to the xref:vertx.adoc[Using Eclipse Vert.x API from a Quarkus Application] guide. It provides more advanced details about the usage and the configuration of the Vert.x instance used by Quarkus. -[#vertx-access] +[[vertx-access]] == Access the Vert.x instance To access the managed Vert.x instance, add the `quarkus-vertx` extension to your project. @@ -230,7 +230,7 @@ Then, create the native executable with: include::{includes}/devtools/build-native.adoc[] -[#using-vert-x-json] +[[using-vert-x-json]] == Use Vert.x JSON Vert.x APIs often rely on JSON. @@ -463,7 +463,7 @@ Thanks to the `@Dependent` scope, it returns a new instance on every call. Finally, you pass the desired number of instances to the `DeploymentOptions`, such as two in the previous example. It will call the supplier twice, which will create two instances of your verticle. -[#eventbus] +[[eventbus]] == Use the Event Bus Vert.x comes with a built-in https://vertx.io/docs/vertx-core/java/#event_bus[event bus] that you can use from your Quarkus application. @@ -942,7 +942,7 @@ The browser must use the `vertx-eventbus` JavaScript library to consume the mess ---- -[#native-transport] +[[native-transport]] == Use native transports IMPORTANT: Native transports are not supported in native executables. @@ -1110,7 +1110,7 @@ See <> for details. IMPORTANT: Make sure your application has the right permissions to write to the socket. -[#use-io_uring] +[[use-io_uring]] == Use io_uring IMPORTANT: `io_uring` is not supported in native executables. @@ -1215,7 +1215,7 @@ java.lang.IllegalStateException: Failed to create cache dir Assuming `/tmp/` is writable this can be fixed by setting the `vertx.cacheDirBase` property to point to a directory in `/tmp/` for instance in OpenShift by creating an environment variable `JAVA_OPTS` with the value `-Dvertx.cacheDirBase=/tmp/vertx`. -[#customizing-the-vert-x-configuration] +[[customizing-the-vert-x-configuration]] == Customize the Vert.x configuration The configuration of the managed Vert.x instance can be provided using the `application.properties` file, but also using _special beans_. diff --git a/docs/src/main/asciidoc/writing-native-applications-tips.adoc b/docs/src/main/asciidoc/writing-native-applications-tips.adoc index aef14713a464a..5bde263c271e9 100644 --- a/docs/src/main/asciidoc/writing-native-applications-tips.adoc +++ b/docs/src/main/asciidoc/writing-native-applications-tips.adoc @@ -216,7 +216,7 @@ An even nastier possible outcome could be for no exception to be thrown, but ins There are two different ways to fix this type of issues. -[#registerForReflection] +[[registerForReflection]] ==== Using the @RegisterForReflection annotation The easiest way to register a class for reflection is to use the `@RegisterForReflection` annotation: From a33aa54a6e15d83ce1a42595b1ca6f814f6ded15 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 7 Feb 2024 13:40:17 +0100 Subject: [PATCH 10/11] Move title attribute to icon Per doc team request. (cherry picked from commit 279a88929aed14db7ff172debd4f69e44291908d) --- .../main/java/io/quarkus/annotation/processor/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/processor/src/main/java/io/quarkus/annotation/processor/Constants.java b/core/processor/src/main/java/io/quarkus/annotation/processor/Constants.java index d9f2f9ac2fd02..6418a4128edb8 100644 --- a/core/processor/src/main/java/io/quarkus/annotation/processor/Constants.java +++ b/core/processor/src/main/java/io/quarkus/annotation/processor/Constants.java @@ -92,7 +92,7 @@ final public class Constants { public static final String DURATION_NOTE_ANCHOR = String.format("duration-note-anchor-{%s}", SUMMARY_TABLE_ID_VARIABLE); public static final String MEMORY_SIZE_NOTE_ANCHOR = "memory-size-note-anchor"; - public static final String MORE_INFO_ABOUT_TYPE_FORMAT = " link:#%s[icon:question-circle[], title=More information about the %s format]"; + public static final String MORE_INFO_ABOUT_TYPE_FORMAT = " link:#%s[icon:question-circle[title=More information about the %s format]]"; public static final String DURATION_INFORMATION = String.format(Constants.MORE_INFO_ABOUT_TYPE_FORMAT, Constants.DURATION_NOTE_ANCHOR, Duration.class.getSimpleName()); public static final String MEMORY_SIZE_INFORMATION = String.format(Constants.MORE_INFO_ABOUT_TYPE_FORMAT, From 7f77c9b46dfc4c27d94ecf1145fb683a6bf64250 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 7 Feb 2024 14:02:55 +0100 Subject: [PATCH 11/11] Replace [#anchors] with [[anchors]] in downstream documentation (cherry picked from commit cdd343ffe8281cd38b48bacb641df0d715a078f0) --- .../docs/generation/AssembleDownstreamDocumentation.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java b/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java index 65a974b7e1964..f2438f7f08a56 100755 --- a/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java +++ b/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java @@ -57,6 +57,8 @@ public class AssembleDownstreamDocumentation { Pattern.CASE_INSENSITIVE); private static final Pattern ANGLE_BRACKETS_WITH_DESCRIPTION_PATTERN = Pattern.compile("<<([a-z0-9_\\-#\\.]+?),([^>]+?)>>", Pattern.CASE_INSENSITIVE); + private static final Pattern ANCHOR_PATTERN = Pattern.compile("^\\[#([a-z0-9_-]+)]$", + Pattern.CASE_INSENSITIVE + Pattern.MULTILINE); private static final String SOURCE_BLOCK_PREFIX = "[source"; private static final String SOURCE_BLOCK_DELIMITER = "--"; @@ -448,6 +450,10 @@ private static String rewriteLinks(String fileName, return "link:" + QUARKUS_IO_GUIDES_ATTRIBUTE + "/" + mr.group(1); }); + content = ANCHOR_PATTERN.matcher(content).replaceAll(mr -> { + return "[[" + mr.group(1) + "]]"; + }); + return content; }