Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@
<!-- Artemis test dependencies -->
<artemis.version>2.44.0</artemis.version>

<!-- Dev Services Images -->
<!-- TODO switch to apache/activemq-artemis to match the artemis version-->
<amqp.image>quay.io/artemiscloud/activemq-artemis-broker:1.0.25</amqp.image>
<apicurio-registry.image>quay.io/apicurio/apicurio-registry-mem:2.6.13.Final</apicurio-registry.image>
<narayana-lra.image>quay.io/jbosstm/lra-coordinator:latest</narayana-lra.image>
<rabbitmq.image>docker.io/rabbitmq:3.12-management</rabbitmq.image>
<pulsar.image>docker.io/apachepulsar/pulsar:3.2.4</pulsar.image>
<redis.image>docker.io/redis:7</redis.image>
<infinispan.image>quay.io/infinispan/server:latest</infinispan.image>

<!-- Code Coverage Properties-->
<jacoco.agent.argLine></jacoco.agent.argLine>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class DiscoveryConfigProperty {
private final SourceElementType sourceElementType;
private final String defaultValue;
private final String defaultValueForDoc;
private final boolean escapeDefaultValueForDoc;
private final Deprecation deprecation;
private final String mapKey;
private final boolean unnamedMapKey;
Expand All @@ -24,8 +25,8 @@ public class DiscoveryConfigProperty {

public DiscoveryConfigProperty(String path, String sourceType, String sourceElementName,
SourceElementType sourceElementType,
String defaultValue,
String defaultValueForDoc, Deprecation deprecation, String mapKey, boolean unnamedMapKey,
String defaultValue, String defaultValueForDoc, boolean escapeDefaultValueForDoc,
Deprecation deprecation, String mapKey, boolean unnamedMapKey,
ResolvedType type, boolean converted, boolean enforceHyphenateEnumValue,
boolean section, boolean sectionGenerated) {
this.path = path;
Expand All @@ -34,6 +35,7 @@ public DiscoveryConfigProperty(String path, String sourceType, String sourceElem
this.sourceElementType = sourceElementType;
this.defaultValue = defaultValue;
this.defaultValueForDoc = defaultValueForDoc;
this.escapeDefaultValueForDoc = escapeDefaultValueForDoc;
this.deprecation = deprecation;
this.mapKey = mapKey;
this.unnamedMapKey = unnamedMapKey;
Expand Down Expand Up @@ -68,6 +70,10 @@ public String getDefaultValueForDoc() {
return defaultValueForDoc;
}

public boolean isEscapeDefaultValueForDoc() {
return escapeDefaultValueForDoc;
}

public Deprecation getDeprecation() {
return deprecation;
}
Expand Down Expand Up @@ -150,6 +156,7 @@ public static class Builder {
private final ResolvedType type;
private String defaultValue;
private String defaultValueForDoc;
private boolean escapeDefaultValueForDoc = true;
private Deprecation deprecation;
private String mapKey;
private boolean unnamedMapKey = false;
Expand Down Expand Up @@ -180,6 +187,11 @@ public Builder defaultValueForDoc(String defaultValueForDoc) {
return this;
}

public Builder escapeDefaultValueForDoc(boolean escapeDefaultValueForDoc) {
this.escapeDefaultValueForDoc = escapeDefaultValueForDoc;
return this;
}

public Builder deprecated(String since, String replacement, String reason) {
this.deprecation = new Deprecation(since, replacement, reason);
return this;
Expand Down Expand Up @@ -220,7 +232,7 @@ public DiscoveryConfigProperty build() {
}

return new DiscoveryConfigProperty(name, sourceType, sourceElementName, sourceElementType, defaultValue,
defaultValueForDoc,
defaultValueForDoc, escapeDefaultValueForDoc,
deprecation, mapKey, unnamedMapKey, type, converted, enforceHyphenateEnumValue, section, sectionGenerated);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public final class ConfigProperty extends AbstractConfigItem {
private final EnumAcceptedValues enumAcceptedValues;

private final String defaultValue;
private final boolean escapeDefaultValue;

private final String javadocSiteLink;

Expand All @@ -35,7 +36,7 @@ public ConfigProperty(ConfigPhase phase, String sourceType, String sourceElement
boolean list, boolean optional, boolean secret,
String mapKey, boolean unnamedMapKey, boolean withinMap, boolean converted, @JsonProperty("enum") boolean isEnum,
EnumAcceptedValues enumAcceptedValues,
String defaultValue, String javadocSiteLink,
String defaultValue, boolean escapeDefaultValue, String javadocSiteLink,
Deprecation deprecation) {
super(sourceType, sourceElementName, sourceElementType, path, type, deprecation);
this.phase = phase;
Expand All @@ -52,6 +53,7 @@ public ConfigProperty(ConfigPhase phase, String sourceType, String sourceElement
this.isEnum = isEnum;
this.enumAcceptedValues = enumAcceptedValues;
this.defaultValue = defaultValue;
this.escapeDefaultValue = escapeDefaultValue;
this.javadocSiteLink = javadocSiteLink;
}

Expand Down Expand Up @@ -121,6 +123,10 @@ public String getDefaultValue() {
return defaultValue;
}

public boolean isEscapeDefaultValue() {
return escapeDefaultValue;
}

public String getJavadocSiteLink() {
return javadocSiteLink;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private void resolveProperty(ConfigRoot configRoot, Map<String, ConfigSection> e
discoveryConfigProperty.isUnnamedMapKey(), context.isWithinMap(),
discoveryConfigProperty.isConverted(),
discoveryConfigProperty.getType().isEnum(),
enumAcceptedValues, defaultValue,
enumAcceptedValues, defaultValue, discoveryConfigProperty.isEscapeDefaultValueForDoc(),
JavadocUtil.getJavadocSiteLink(typeBinaryName),
deprecation);
context.getItemCollection().addItem(configProperty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ public void onEnclosedMethod(DiscoveryRootElement discoveryRootElement, TypeElem

AnnotationMirror configDocDefaultAnnotation = methodAnnotations.get(Types.ANNOTATION_CONFIG_DOC_DEFAULT);
if (configDocDefaultAnnotation != null) {
builder.defaultValueForDoc(
configDocDefaultAnnotation.getElementValues().values().iterator().next().getValue().toString());
String value = (String) utils.element().getAnnotationValues(configDocDefaultAnnotation).get("value");
builder.defaultValueForDoc(value);
Boolean escape = (Boolean) utils.element().getAnnotationValues(configDocDefaultAnnotation).get("escape");
if (escape != null) {
builder.escapeDefaultValueForDoc(escape);
}
}

if (resolvedType.isMap()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
public @interface ConfigDocDefault {

String value();

boolean escape() default true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ private String formatSingleDefaultValue(ConfigProperty configProperty, String de
}
}

return escapeDefaultValue(defaultValue);
if (configProperty.isEscapeDefaultValue()) {
return escapeDefaultValue(defaultValue);
} else {
return defaultValue;
}
}

private static String trimFinalDot(String javadoc) {
Expand Down
15 changes: 14 additions & 1 deletion docs/src/main/asciidoc/_attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,27 @@
:mandrel-flavor: ${mandrel.image-tag-for-documentation}
:surefire-version: ${version.surefire.plugin}
:gradle-version: ${gradle-wrapper.version}
:db2-image: ${db2.image}
:mariadb-image: ${mariadb.image}
:mssql-image: ${mssql.image}
:oracle-image: ${oracle.image}
:postgres-image: ${postgres.image}
:elasticsearch-version: ${elasticsearch-server.version}
:elasticsearch-image: ${elasticsearch.image}
:opensearch-image: ${opensearch.image}
:infinispan-version: ${infinispan.version}
:infinispan-protostream-version: ${infinispan.protostream.version}
:logstash-image: ${logstash.image}
:kibana-image: ${kibana.image}
:keycloak-docker-image: ${keycloak.docker.image}
:keycloak-image: ${keycloak.docker.image}
:amqp-image: ${amqp.image}
:apicurio-registry-image: ${apicurio-registry.image}
:narayana-lra-image: ${narayana-lra.image}
:mongo-image: ${mongo.image}
:rabbitmq-image: ${rabbitmq.image}
:pulsar-image: ${pulsar.image}
:redis-image: ${redis.image}
:infinispan-image: ${infinispan.image}
:jandex-version: ${jandex.version}
:jandex-gradle-plugin-version: ${jandex-gradle-plugin.version}
:kotlin-version: ${kotlin.version}
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/amqp-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ You can set the port by configuring the `quarkus.amqp.devservices.port` property
Dev Services for AMQP uses https://quay.io/repository/artemiscloud/activemq-artemis-broker[activemq-artemis-broker] images.
You can configure the image and version using the `quarkus.amqp.devservices.image-name` property:

[source, properties]
[source, properties, subs=attributes+]
----
quarkus.amqp.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:latest
quarkus.amqp.devservices.image-name={amqp-image}
----

IMPORTANT: The configured image must be _compatible_ with the `activemq-artemis-broker` one.
Expand All @@ -65,12 +65,12 @@ The ports 5672 and 8161 (web console) are exposed.
Dev Services for AMQP supports xref:compose-dev-services.adoc[Compose Dev Services].
It relies on a `compose-devservices.yml`, such as:

[source,yaml]
[source,yaml,subs=attributes+]
----
name: <application name>
services:
artemis:
image: quay.io/artemiscloud/activemq-artemis-broker:1.0.28
image: {amqp-image}
ports:
- "5672"
- "8161"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/amqp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ Open `http://localhost:8080/quotes.html` in your browser and request some quotes
When not running in dev or test mode, you will need to start your AMQP broker.
You can follow the instructions from the https://activemq.apache.org/components/artemis/documentation/latest/using-server.html[Apache ActiveMQ Artemis website] or create a `docker-compose.yaml` file with the following content:

[source, yaml]
[source, yaml ,subs=attributes+]
----
version: '2'
services:
artemis:
image: quay.io/artemiscloud/activemq-artemis-broker:1.0.25
image: {amqp-image}
ports:
- "8161:8161"
- "61616:61616"
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/asciidoc/apicurio-registry-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ Note that the Kafka channels in SmallRye Reactive messaging are automatically co
Dev Services for Apicurio Registry uses `apicurio/apicurio-registry-mem` images.
You can select any 2.x version from https://hub.docker.com/r/apicurio/apicurio-registry-mem:

[source, properties]
[source,properties,subs=attributes+]
----
quarkus.apicurio-registry.devservices.image-name=apicurio/apicurio-registry-mem:latest-snapshot
quarkus.apicurio-registry.devservices.image-name={apicurio-registry-image}
----

[[Compose]]
Expand All @@ -86,12 +86,12 @@ quarkus.apicurio-registry.devservices.image-name=apicurio/apicurio-registry-mem:
The Apicurio Dev Services supports xref:compose-dev-services.adoc[Compose Dev Services].
It relies on a `compose-devservices.yml`, such as:

[source,yaml]
[source,yaml,subs=attributes+]
----
name: <application name>
services:
apicurio:
image: apicurio/apicurio-registry-mem:2.4.2.Final
image: {apicurio-registry-image}
ports:
- "8080"
----
----
32 changes: 16 additions & 16 deletions docs/src/main/asciidoc/compose-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ Let's see how to use Compose Dev Services with examples ranging from simple to m
In a Quarkus project already configured to use the `quarkus-jdbc-postgresql` extension,
you can create a `compose-devservices.yml` file in the root of the project and define a custom service using Compose:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
healthcheck:
test: pg_isready -U myuser -d mydb
interval: 5s
Expand All @@ -84,11 +84,11 @@ and the application datasource will be configured by extracting connection infor

For more complex scenarios, you can define custom networks and service dependencies:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
ports:
- '5432'
environment:
Expand All @@ -101,7 +101,7 @@ services:
- postgres-data:/var/lib/postgresql/data

cache:
image: redis:7
image: {redis-image}
command: redis-server --save 60 1 --loglevel warning
ports:
- '6379'
Expand All @@ -111,7 +111,7 @@ services:
- db

message-broker:
image: rabbitmq:3-management
image: {rabbitmq-image}
ports:
- '5672'
- '15672'
Expand Down Expand Up @@ -294,11 +294,11 @@ quarkus.compose.devservices.files=src/main/docker/base-compose.yml,src/main/dock
With profiles, Compose files can define a set of active profiles so that started services are adjusted for various usages and environments.
You can specify the profiles to activate by setting the `quarkus.compose.devservices.profiles` property in the `application.properties` file:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
profiles:
- dev
- local
Expand All @@ -319,11 +319,11 @@ services:

You can configure Compose Dev Services to not discover specific services by adding the `io.quarkus.devservices.compose.ignore` label to the service in your Compose file:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
labels:
io.quarkus.devservices.compose.ignore: true
ports:
Expand All @@ -345,11 +345,11 @@ Compose Dev Services provides several ways to ensure services are ready before y
Compose Dev Services respects the health checks defined in your Compose file.
It's recommended to configure health checks for your services to ensure they are ready before your application tries to use them:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
healthcheck:
test: pg_isready -U myuser -d mydb
interval: 5s
Expand Down Expand Up @@ -419,11 +419,11 @@ This property sets the maximum time to wait for all Dev Services to start. The d
Compose Dev Services starts services in the order they are defined in the Compose file.
If you need to start services in a specific order, you can use the `depends_on` attribute:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: postgres:17
image: {postgres-image}
ports:
- '5432'
environment:
Expand All @@ -444,11 +444,11 @@ services:
Compose Dev Services automatically exposes the configuration of discovered services to your application.
For example, when a database service is discovered with the following compose service description:

[source, yaml]
[source, yaml, subs=attributes+]
----
services:
db:
image: mysql:17
image: {mysql-image}
ports:
- '9906:3306'
labels:
Expand Down
Loading
Loading