Skip to content

Commit

Permalink
Merge branch 'quarkusio:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik authored Jan 29, 2024
2 parents 6aafd1d + 391ca5a commit b2c779f
Show file tree
Hide file tree
Showing 145 changed files with 4,028 additions and 632 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ updates:
- dependency-name: org.elasticsearch.client:elasticsearch-rest-client
- dependency-name: org.elasticsearch.client:elasticsearch-rest-client-sniffer
- dependency-name: co.elastic.clients:elasticsearch-java
# Gradle extensions present in .mvn/extensions.xml
- dependency-name: com.gradle:*
# Others
- dependency-name: com.puppycrawl.tools:checkstyle
- dependency-name: com.google.cloud.functions:*
Expand Down
4 changes: 2 additions & 2 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<extension>
<groupId>com.gradle</groupId>
<artifactId>gradle-enterprise-maven-extension</artifactId>
<version>1.18.1</version>
<version>1.20</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>1.12.2</version>
<version>1.12.5</version>
</extension>
</extensions>
16 changes: 8 additions & 8 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.5</parsson.version>
<resteasy-microprofile.version>2.1.5.Final</resteasy-microprofile.version>
<resteasy-spring-web.version>3.1.0.Final</resteasy-spring-web.version>
<resteasy-spring-web.version>3.1.1.Final</resteasy-spring-web.version>
<resteasy.version>6.2.7.Final</resteasy.version>
<opentracing.version>0.33.0</opentracing.version>
<opentracing-jdbc.version>0.2.4</opentracing-jdbc.version>
Expand Down Expand Up @@ -62,7 +62,7 @@
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>3.0.1</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>3.8.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>4.15.0</smallrye-reactive-messaging.version>
<smallrye-reactive-messaging.version>4.16.0</smallrye-reactive-messaging.version>
<smallrye-stork.version>2.5.0</smallrye-stork.version>
<jakarta.activation.version>2.1.2</jakarta.activation.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
Expand Down Expand Up @@ -90,7 +90,7 @@
<maven-toolchain.version>3.0-alpha-2</maven-toolchain.version>
<plexus-component-annotations.version>2.1.0</plexus-component-annotations.version>
<graal-sdk.version>23.0.1</graal-sdk.version>
<gizmo.version>1.7.0</gizmo.version>
<gizmo.version>1.8.0</gizmo.version>
<jackson-bom.version>2.16.1</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
Expand All @@ -103,7 +103,7 @@
<hibernate-orm.version>6.4.2.Final</hibernate-orm.version>
<bytebuddy.version>1.14.7</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.2.1.Final</hibernate-reactive.version>
<hibernate-reactive.version>2.2.2.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>7.0.0.Final</hibernate-search.version>
Expand Down Expand Up @@ -144,11 +144,11 @@
<infinispan.version>14.0.21.Final</infinispan.version>
<infinispan.protostream.version>4.6.5.Final</infinispan.protostream.version>
<caffeine.version>3.1.5</caffeine.version>
<netty.version>4.1.103.Final</netty.version>
<netty.version>4.1.106.Final</netty.version>
<brotli4j.version>1.12.0</brotli4j.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>
<mutiny.version>2.5.4</mutiny.version>
<mutiny.version>2.5.6</mutiny.version>
<kafka3.version>3.6.1</kafka3.version>
<lz4.version>1.8.0</lz4.version> <!-- dependency of the kafka-clients that could be overridden by other imported BOMs in the platform -->
<snappy.version>1.1.10.5</snappy.version>
Expand Down Expand Up @@ -185,7 +185,7 @@
<quarkus-spring-data-api.version>2.1.SP2</quarkus-spring-data-api.version>
<quarkus-spring-security-api.version>5.4.Final</quarkus-spring-security-api.version>
<quarkus-spring-boot-api.version>2.1.SP1</quarkus-spring-boot-api.version>
<mockito.version>5.8.0</mockito.version>
<mockito.version>5.10.0</mockito.version>
<jna.version>5.8.0</jna.version><!-- should satisfy both testcontainers and mongodb -->
<antlr.version>4.13.0</antlr.version><!-- needs to align with same property in build-parent/pom.xml -->
<quarkus-security.version>2.0.3.Final</quarkus-security.version>
Expand All @@ -207,7 +207,7 @@
<avro.version>1.11.3</avro.version>
<apicurio-registry.version>2.5.8.Final</apicurio-registry.version>
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
<testcontainers.version>1.19.3</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<testcontainers.version>1.19.4</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<docker-java.version>3.3.4</docker-java.version> <!-- must be the version Testcontainers use -->
<!-- Check the compatibility matrix (https://github.com/opensearch-project/opensearch-testcontainers) before upgrading: -->
<opensearch-testcontainers.version>2.0.0</opensearch-testcontainers.version>
Expand Down
8 changes: 5 additions & 3 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@
<!-- MicroProfile TCK versions used to be defined here but have moved to the concrete tck modules -->

<!-- Panache needs to run the hibernate-jpamodelgen annotation processor,
and unfortunately annotation processors are not covered by dependency management -->
<hibernate-orm.version>6.4.0.Final</hibernate-orm.version>
but version 6.3+ leads to issues in applications that use it too:
https://github.com/quarkusio/quarkus/issues/38378
As a workaround, we generate the static metamodel of Panache using an older version of jpamodelgen. -->
<hibernate-orm.jpamodelgen.for-panache.version>6.2.22.Final</hibernate-orm.jpamodelgen.for-panache.version>
<!-- Antlr 4 is used by the PanacheQL parser but also needs to match the requirements of Hibernate ORM 6.x-->
<antlr.version>4.13.0</antlr.version>

Expand Down Expand Up @@ -111,7 +113,7 @@

<unboundid-ldap.version>6.0.11</unboundid-ldap.version>

<assertj.version>3.25.1</assertj.version>
<assertj.version>3.25.2</assertj.version>

<wiremock.version>3.3.1</wiremock.version>
<wiremock-maven-plugin.version>7.3.0</wiremock-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Map;
import java.util.regex.Pattern;

import io.quarkus.bootstrap.util.PropertyUtils;
import io.quarkus.deployment.configuration.BuildTimeConfigurationReader;
import io.quarkus.runtime.LaunchMode;

Expand Down Expand Up @@ -107,108 +108,6 @@ public static void write(Map<String, String> readOptions, ConfigTrackingConfig c
* @throws IOException in case of a failure
*/
public static void write(Writer writer, String name, String value) throws IOException {
if (value != null) {
name = toWritableValue(name, true, true);
value = toWritableValue(value, false, true);
writer.write(name);
writer.write("=");
writer.write(value);
writer.write(System.lineSeparator());
}
}

/*
* Converts unicodes to encoded &#92;uxxxx and escapes
* special characters with a preceding slash
*/

/**
* Escapes characters that are expected to be escaped when {@link java.util.Properties} load
* files from disk.
*
* @param str property name or value
* @param escapeSpace whether to escape a whitespace (should be true for property names)
* @param escapeUnicode whether to converts unicodes to encoded &#92;uxxxx
* @return property name or value that can be written to a file
*/
private static String toWritableValue(String str, boolean escapeSpace, boolean escapeUnicode) {
int len = str.length();
int bufLen = len * 2;
if (bufLen < 0) {
bufLen = Integer.MAX_VALUE;
}
StringBuilder outBuffer = new StringBuilder(bufLen);

for (int x = 0; x < len; x++) {
char aChar = str.charAt(x);
// Handle common case first, selecting largest block that
// avoids the specials below
if ((aChar > 61) && (aChar < 127)) {
if (aChar == '\\') {
outBuffer.append('\\');
outBuffer.append('\\');
continue;
}
outBuffer.append(aChar);
continue;
}
switch (aChar) {
case ' ':
if (x == 0 || escapeSpace) {
outBuffer.append('\\');
}
outBuffer.append(' ');
break;
case '\t':
outBuffer.append('\\');
outBuffer.append('t');
break;
case '\n':
outBuffer.append('\\');
outBuffer.append('n');
break;
case '\r':
outBuffer.append('\\');
outBuffer.append('r');
break;
case '\f':
outBuffer.append('\\');
outBuffer.append('f');
break;
case '=': // Fall through
case ':': // Fall through
case '#': // Fall through
case '!':
outBuffer.append('\\');
outBuffer.append(aChar);
break;
default:
if (((aChar < 0x0020) || (aChar > 0x007e)) & escapeUnicode) {
outBuffer.append('\\');
outBuffer.append('u');
outBuffer.append(toHex((aChar >> 12) & 0xF));
outBuffer.append(toHex((aChar >> 8) & 0xF));
outBuffer.append(toHex((aChar >> 4) & 0xF));
outBuffer.append(toHex(aChar & 0xF));
} else {
outBuffer.append(aChar);
}
}
}
return outBuffer.toString();
}

/**
* Convert a nibble to a hex character
*
* @param nibble the nibble to convert.
*/
private static char toHex(int nibble) {
return hexDigit[(nibble & 0xF)];
PropertyUtils.store(writer, name, value);
}

/** A table of hex digits */
private static final char[] hexDigit = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ public class TestConfig {
public static class Profile {

/**
* The profile (dev, test or prod) to use when testing using @QuarkusTest
* A comma separated list of profiles (dev, test, prod or custom profiles) to use when testing using @QuarkusTest
*/
@ConfigItem(name = ConfigItem.PARENT, defaultValue = "test")
String profile;
List<String> profile;

/**
* The tags this profile is associated with.
Expand Down
10 changes: 10 additions & 0 deletions core/processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-app-model</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import io.quarkus.annotation.processor.generate_doc.ConfigDocItemScanner;
import io.quarkus.annotation.processor.generate_doc.ConfigDocWriter;
import io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil;
import io.quarkus.bootstrap.util.PropertyUtils;

public class ExtensionAnnotationProcessor extends AbstractProcessor {

Expand Down Expand Up @@ -239,23 +240,23 @@ public FileVisitResult postVisitDirectory(final Path dir, final IOException exc)
}
}

try {

final FileObject listResource = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
"META-INF/quarkus-javadoc.properties");
try (OutputStream os = listResource.openOutputStream()) {
try (BufferedOutputStream bos = new BufferedOutputStream(os)) {
try (OutputStreamWriter osw = new OutputStreamWriter(bos, StandardCharsets.UTF_8)) {
try (BufferedWriter bw = new BufferedWriter(osw)) {
javaDocProperties.store(bw, Constants.EMPTY);
if (!javaDocProperties.isEmpty()) {
try {
final FileObject listResource = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
"META-INF/quarkus-javadoc.properties");
try (OutputStream os = listResource.openOutputStream()) {
try (BufferedOutputStream bos = new BufferedOutputStream(os)) {
try (OutputStreamWriter osw = new OutputStreamWriter(bos, StandardCharsets.UTF_8)) {
try (BufferedWriter bw = new BufferedWriter(osw)) {
PropertyUtils.store(javaDocProperties, bw);
}
}
}
}
} catch (IOException e) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed to write javadoc properties: " + e);
return;
}

} catch (IOException e) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed to write javadoc properties: " + e);
return;
}

try {
Expand Down Expand Up @@ -528,7 +529,7 @@ private void writeJavadocProperties(final TypeElement clazz, final Properties ja
rbn,
clazz);
try (Writer writer = file.openWriter()) {
javadocProps.store(writer, Constants.EMPTY);
PropertyUtils.store(javadocProps, writer);
}
} catch (IOException e) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed to persist resource " + rbn + ": " + e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
@ConfigRoot(phase = ConfigPhase.RUN_TIME)
public interface ConfigConfig {
/**
* Profile that will be active when Quarkus launches.
* A comma separated list of profiles that will be active when Quarkus launches.
*/
Optional<String> profile();
Optional<List<String>> profile();

/**
* Accepts a single configuration profile name. If a configuration property cannot be found in the current active
Expand Down
5 changes: 5 additions & 0 deletions devtools/cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-crypto</artifactId>
<scope>test</scope>
</dependency>
<!-- This dependency is here to make sure the build order is correct-->
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
29 changes: 29 additions & 0 deletions devtools/cli/src/main/java/io/quarkus/cli/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.quarkus.cli;

import java.util.List;
import java.util.concurrent.Callable;

import io.quarkus.cli.common.OutputOptionMixin;
import io.quarkus.cli.config.Encrypt;
import io.quarkus.cli.config.SetConfig;
import picocli.CommandLine;
import picocli.CommandLine.Command;

@Command(name = "config", header = "Manage Quarkus configuration", subcommands = { SetConfig.class, Encrypt.class })
public class Config implements Callable<Integer> {
@CommandLine.Mixin(name = "output")
protected OutputOptionMixin output;

@CommandLine.Spec
protected CommandLine.Model.CommandSpec spec;

@CommandLine.Unmatched // avoids throwing errors for unmatched arguments
List<String> unmatchedArgs;

@Override
public Integer call() throws Exception {
CommandLine.ParseResult result = spec.commandLine().getParseResult();
CommandLine appCommand = spec.subcommands().get("set");
return appCommand.execute(result.originalArgs().stream().filter(x -> !"config".equals(x)).toArray(String[]::new));
}
}
10 changes: 9 additions & 1 deletion devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@
import picocli.CommandLine.UnmatchedArgumentException;

@CommandLine.Command(name = "quarkus", subcommands = {
Create.class, Build.class, Dev.class, Run.class, Test.class, ProjectExtensions.class, Image.class, Deploy.class,
Create.class,
Build.class,
Dev.class,
Run.class,
Test.class,
Config.class,
ProjectExtensions.class,
Image.class,
Deploy.class,
Registry.class,
Info.class,
Update.class,
Expand Down
Loading

0 comments on commit b2c779f

Please sign in to comment.