Skip to content

Commit

Permalink
Merge pull request #38354 from gsmet/3.7.0-backports-1
Browse files Browse the repository at this point in the history
3.7.0 backports 1
  • Loading branch information
gsmet committed Jan 24, 2024
2 parents 8bc6ddb + f9c960a commit 0e5d468
Show file tree
Hide file tree
Showing 194 changed files with 5,858 additions and 1,547 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
env:
CAPTURE_BUILD_SCAN: true
run: |
./mvnw -T1C $COMMON_MAVEN_ARGS -DskipTests -DskipITs -DskipDocs -Dinvoker.skip -Dno-format -Dtcks -Prelocations clean install
./mvnw -T1C $COMMON_MAVEN_ARGS -DskipTests -DskipITs -DskipDocs -Dinvoker.skip -Dskip.gradle.tests -Djbang.skip -Dtruststore.skip -Dno-format -Dtcks -Prelocations clean install
- name: Verify extension dependencies
run: ./update-extension-dependencies.sh $COMMON_MAVEN_ARGS
- name: Get GIB arguments
Expand Down
14 changes: 7 additions & 7 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.5</parsson.version>
<resteasy-microprofile.version>2.1.4.Final</resteasy-microprofile.version>
<resteasy-microprofile.version>2.1.5.Final</resteasy-microprofile.version>
<resteasy-spring-web.version>3.1.0.Final</resteasy-spring-web.version>
<resteasy.version>6.2.7.Final</resteasy.version>
<opentracing.version>0.33.0</opentracing.version>
Expand Down Expand Up @@ -100,7 +100,7 @@
bytebuddy.version (just below), hibernate-orm.version-for-documentation (in docs/pom.xml)
and both hibernate-orm.version and antlr.version in build-parent/pom.xml
WARNING again for diffs that don't provide enough context: when updating, see above -->
<hibernate-orm.version>6.4.1.Final</hibernate-orm.version>
<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>
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.3</mutiny.version>
<mutiny.version>2.5.4</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 @@ -188,8 +188,8 @@
<mockito.version>5.8.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.2.Final</quarkus-security.version>
<keycloak.version>23.0.3</keycloak.version>
<quarkus-security.version>2.0.3.Final</quarkus-security.version>
<keycloak.version>23.0.4</keycloak.version>
<logstash-gelf.version>1.15.1</logstash-gelf.version>
<checker-qual.version>3.42.0</checker-qual.version>
<error-prone-annotations.version>2.24.0</error-prone-annotations.version>
Expand Down Expand Up @@ -221,7 +221,7 @@
<strimzi-oauth.nimbus.version>9.37.3</strimzi-oauth.nimbus.version>
<java-buildpack-client.version>0.0.6</java-buildpack-client.version>
<org-crac.version>0.1.3</org-crac.version>
<sshd-common.version>2.10.0</sshd-common.version>
<sshd-common.version>2.12.0</sshd-common.version>
<mime4j.version>0.8.9</mime4j.version>
<mutiny-zero.version>1.0.0</mutiny-zero.version>
<pulsar-client.version>3.0.0</pulsar-client.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

<!-- The image to use for tests that run Keycloak -->
<!-- IMPORTANT: If this is changed you must also update bom/application/pom.xml and KeycloakBuildTimeConfig/DevServicesConfig in quarkus-oidc/deployment to match the version -->
<keycloak.version>23.0.3</keycloak.version>
<keycloak.version>23.0.4</keycloak.version>
<keycloak.wildfly.version>19.0.3</keycloak.wildfly.version>
<keycloak.docker.image>quay.io/keycloak/keycloak:${keycloak.version}</keycloak.docker.image>
<keycloak.docker.legacy.image>quay.io/keycloak/keycloak:${keycloak.wildfly.version}-legacy</keycloak.docker.legacy.image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ public ConsoleCommand(char key, String description, HelpState helpState, Runnabl
this(key, description, null, -1, helpState, runnable);
}

public static ConsoleCommand duplicateCommandWithNewPromptString(ConsoleCommand commandToDuplicate,
String newPromptString) {
return new ConsoleCommand(commandToDuplicate.getKey(),
commandToDuplicate.getDescription(),
newPromptString,
commandToDuplicate.getPromptPriority(),
commandToDuplicate.getHelpState(),
commandToDuplicate.getReadLineHandler());
}

public char getKey() {
return key;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,20 @@ public static void init(QuarkusConsole console, DevModeType devModeType) {
}

void installBuiltins(DevModeType devModeType) {
final String editPromptFormat = "to edit command line args (currently '"
+ MessageFormat.GREEN
+ "%s"
+ MessageFormat.RESET
+ "')";
ConsoleContext context = createContext("System");
List<ConsoleCommand> commands = new ArrayList<>();
if (devModeType != DevModeType.TEST_ONLY) {
commands.add(new ConsoleCommand('s', "Force restart", null, () -> {
forceRestart();
}));
commands.add(new ConsoleCommand('e', "Edits the command line parameters and restarts",
"to edit command line args (currently '" + MessageFormat.GREEN
+ String.join(" ", RuntimeUpdatesProcessor.INSTANCE.getCommandLineArgs()) + MessageFormat.RESET
+ "')",
editPromptFormat.formatted(String.join(" ",
RuntimeUpdatesProcessor.INSTANCE.getCommandLineArgs())),
100, new ConsoleCommand.HelpState(() -> BLUE,
() -> String.join(" ", RuntimeUpdatesProcessor.INSTANCE.getCommandLineArgs())),
new Consumer<String>() {
Expand All @@ -121,6 +126,10 @@ public void accept(String args) {
Logger.getLogger(ConsoleStateManager.class).errorf(e, "Failed to parse command line %s", args);
return;
}
// Reload command prompt string
context.reset(ConsoleCommand.duplicateCommandWithNewPromptString(context.getCommandByKey('e'),
editPromptFormat.formatted(String.join(" ",
RuntimeUpdatesProcessor.INSTANCE.getCommandLineArgs()))));
RuntimeUpdatesProcessor.INSTANCE.doScan(true, true);
}
}));
Expand All @@ -145,8 +154,6 @@ public void accept(String args) {
}));
}

ConsoleContext context = createContext("System");

commands.add(new ConsoleCommand('j', "Toggle log levels",
new ConsoleCommand.HelpState(() -> currentLevel == null ? BLUE : RED,
() -> (currentLevel == null
Expand Down Expand Up @@ -280,8 +287,9 @@ public ConsoleContext createContext(String name) {
void redraw() {

List<ConsoleCommand> sorted = commands.values().stream().map(s -> s.consoleCommand)
.filter(s -> s.getPromptString() != null).sorted(Comparator.comparingInt(ConsoleCommand::getPromptPriority))
.collect(Collectors.toList());
.filter(s -> s.getPromptString() != null)
.sorted(Comparator.comparingInt(ConsoleCommand::getPromptPriority))
.toList();
if (sorted.isEmpty()) {
QuarkusConsole.INSTANCE.setPromptMessage(null);
oldPrompt = null;
Expand Down Expand Up @@ -338,6 +346,12 @@ public void addCommandInternal(ConsoleCommand consoleCommand) {
}
}

public ConsoleCommand getCommandByKey(Character key) {
synchronized (commands) {
return commands.get(key).consoleCommand;
}
}

public void reset(ConsoleCommand... command) {
synchronized (commands) {
internal.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ default BuildCommandArgs prependExecutable(ArrayDeque<String> args) {

default void paramsToQuarkusArgs(List<String> params, ArrayDeque<String> args) {
if (!params.isEmpty()) {
args.add("-Dquarkus.args='" + String.join(" ", params) + "'");
args.add("-Dquarkus.args=" + String.join(" ", wrapWithDoubleQuotes(params)));
}
}

default List<String> wrapWithDoubleQuotes(List<String> stringsToWrap) {
return stringsToWrap.stream()
.map("\"%s\""::formatted)
.toList();
}

default List<String> flattenMappedProperties(Map<String, String> props) {
List<String> result = new ArrayList<>();
props.entrySet().forEach(x -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ public void testDevOptions() throws Exception {
Assertions.assertFalse(result.stdout.contains("-Dsuspend"),
"gradle command should not specify '-Dsuspend'\n" + result);

Assertions.assertTrue(result.stdout.contains("-Dquarkus.args='arg1 arg2'"),
"gradle command should not specify -Dquarkus.args='arg1 arg2'\n" + result);
Assertions.assertTrue(result.stdout.contains("-Dquarkus.args=\"arg1\" \"arg2\""),
"gradle command should not specify -Dquarkus.args=\"arg1\" \"arg2\"\n" + result);

// 4 TEST MODE: test --clean --debug --suspend --offline
result = CliDriver.execute(project, "test", "-e", "--dry-run",
Expand All @@ -366,6 +366,13 @@ public void testDevOptions() throws Exception {
"Expected OK return code. Result:\n" + result);
Assertions.assertTrue(result.stdout.contains("Run current project in test mode"), result.toString());
Assertions.assertTrue(result.stdout.contains("--tests FooTest"), result.toString());

// 6 TEST MODE: Two word argument
result = CliDriver.execute(project, "dev", "-e", "--dry-run",
"--no-suspend", "--debug-host=0.0.0.0", "--debug-port=8008", "--debug-mode=connect", "--", "arg1 arg2");

Assertions.assertTrue(result.stdout.contains("-Dquarkus.args=\"arg1 arg2\""),
"mvn command should not specify -Dquarkus.args=\"arg1 arg2\"\n" + result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ public void testDevTestOptions() throws Exception {
Assertions.assertFalse(result.stdout.contains("-Dsuspend"),
"mvn command should not specify '-Dsuspend'\n" + result);

Assertions.assertTrue(result.stdout.contains("-Dquarkus.args='arg1 arg2'"),
"mvn command should not specify -Dquarkus.args='arg1 arg2'\n" + result);
Assertions.assertTrue(result.stdout.contains("-Dquarkus.args=\"arg1\" \"arg2\""),
"mvn command should not specify -Dquarkus.args=\"arg1\" \"arg2\"\n" + result);

// 4 TEST MODE: test --clean --debug --suspend --offline
result = CliDriver.execute(project, "test", "-e", "--dry-run",
Expand All @@ -291,6 +291,13 @@ public void testDevTestOptions() throws Exception {
"Expected OK return code. Result:\n" + result);
Assertions.assertTrue(result.stdout.contains("Run current project in test mode"), result.toString());
Assertions.assertTrue(result.stdout.contains("-Dtest=FooTest"), result.toString());

// 6 TEST MODE: Two word argument
result = CliDriver.execute(project, "dev", "-e", "--dry-run",
"--no-suspend", "--debug-host=0.0.0.0", "--debug-port=8008", "--debug-mode=connect", "--", "arg1 arg2");

Assertions.assertTrue(result.stdout.contains("-Dquarkus.args=\"arg1 arg2\""),
"mvn command should not specify -Dquarkus.args=\"arg1 arg2\"\n" + result);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public void apply(Project project) {
final QuarkusPluginExtension quarkusExt = project.getExtensions().create(EXTENSION_NAME, QuarkusPluginExtension.class,
project);

createSourceSets(project);
createConfigurations(project);
registerTasks(project, quarkusExt);
}
Expand Down Expand Up @@ -323,7 +324,7 @@ public boolean isSatisfiedBy(Task t) {
quarkusGenerateCodeDev.configure(task -> task.setSourcesDirectories(getSourcesParents(mainSourceSet)));
quarkusGenerateCodeTests.configure(task -> task.setSourcesDirectories(getSourcesParents(testSourceSet)));

SourceSet intTestSourceSet = sourceSets.create(INTEGRATION_TEST_SOURCE_SET_NAME);
SourceSet intTestSourceSet = sourceSets.getByName(INTEGRATION_TEST_SOURCE_SET_NAME);
intTestSourceSet.setCompileClasspath(
intTestSourceSet.getCompileClasspath()
.plus(mainSourceSet.getOutput())
Expand All @@ -345,7 +346,7 @@ public boolean isSatisfiedBy(Task t) {
intTestTask.setTestClassesDirs(intTestSourceOutputClasses);
});

SourceSet nativeTestSourceSet = sourceSets.create(NATIVE_TEST_SOURCE_SET_NAME);
SourceSet nativeTestSourceSet = sourceSets.getByName(NATIVE_TEST_SOURCE_SET_NAME);
nativeTestSourceSet.setCompileClasspath(
nativeTestSourceSet.getCompileClasspath()
.plus(mainSourceSet.getOutput())
Expand Down Expand Up @@ -391,8 +392,8 @@ public void execute(Task task) {
// quarkusBuild is expected to run after the project has passed the tests
quarkusBuildCacheableAppParts.configure(task -> task.shouldRunAfter(tasks.withType(Test.class)));

SourceSet generatedSourceSet = sourceSets.create(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
SourceSet generatedTestSourceSet = sourceSets.create(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
SourceSet generatedSourceSet = sourceSets.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
SourceSet generatedTestSourceSet = sourceSets.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);

// Register the quarkus-generated-code
for (String provider : QuarkusGenerateCode.CODE_GENERATION_PROVIDER) {
Expand Down Expand Up @@ -423,14 +424,22 @@ private static void configureGenerateCodeTask(QuarkusGenerateCode task, String g
task.getGeneratedOutputDirectory().set(generatedSources.getJava().getClassesDirectory().get().getAsFile());
}

private void createSourceSets(Project project) {
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
sourceSets.create(INTEGRATION_TEST_SOURCE_SET_NAME);
sourceSets.create(NATIVE_TEST_SOURCE_SET_NAME);
sourceSets.create(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
sourceSets.create(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
}

private void createConfigurations(Project project) {

final ConfigurationContainer configContainer = project.getConfigurations();

// Custom configuration to be used for the dependencies of the testNative task
configContainer.maybeCreate(NATIVE_TEST_IMPLEMENTATION_CONFIGURATION_NAME)
configContainer.getByName(NATIVE_TEST_IMPLEMENTATION_CONFIGURATION_NAME)
.extendsFrom(configContainer.findByName(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME));
configContainer.maybeCreate(NATIVE_TEST_RUNTIME_ONLY_CONFIGURATION_NAME)
configContainer.getByName(NATIVE_TEST_RUNTIME_ONLY_CONFIGURATION_NAME)
.extendsFrom(configContainer.findByName(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME));

// create a custom configuration to be used for the dependencies of the quarkusIntTest task
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/cdi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Client proxies allow for:
* Circular dependencies in the dependency graph. Having circular dependencies is often an indication that a redesign should be considered, but sometimes it's inevitable.
* In rare cases it's practical to destroy the beans manually. A direct injected reference would lead to a stale bean instance.
[[ok-you-said-that-there-are-several-kinds-of-beans]]
== OK. You said that there are several kinds of beans?
Yes. In general, we distinguish:
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ By default, Quarkus provides three profiles, that activate automatically in cert
* *test* - Activated when running tests
* *prod* - The default profile when not running in development or test mode

[[custom-profiles]]
=== Custom Profiles

It is also possible to create additional profiles and activate them with the `quarkus.profile` configuration property. A
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/container-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ For example, the presence of `src/main/jib/foo/bar` would result in `/foo/bar`

There are cases where the built container image may need to have Java debugging conditionally enabled at runtime.

When the base image has not been changed (and therefore `ubi8/openjdk-11-runtime`, `ubi8/openjdk-17-runtime`, or `ubi8/openjdk-21-runtime` is used), then the `quarkus.jib.jvm-arguments` configuration property can be used in order to
When the base image has not been changed (and therefore `ubi8/openjdk-11-runtime`, `ubi8/openjdk-17-runtime`, or `ubi8/openjdk-21-runtime` is used), then the `quarkus.jib.jvm-additional-arguments` configuration property can be used in order to
make the JVM listen on the debug port at startup.

The exact configuration is:

[source,properties]
----
quarkus.jib.jvm-arguments=-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=n\\,address=*:5005
quarkus.jib.jvm-additional-arguments=-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=n\\,address=*:5005
----

Other base images might provide launch scripts that enable debugging when an environment variable is set, in which case you would set than environment variable when launching the container.
Expand Down
Loading

0 comments on commit 0e5d468

Please sign in to comment.