Skip to content

Commit eb7fd03

Browse files
authored
Merge pull request #49909 from gsmet/3.26.3-backports-1
[3.26] 3.26.3 backports 1
2 parents 585e2a5 + 75bf854 commit eb7fd03

File tree

50 files changed

+710
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+710
-149
lines changed

bom/application/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,31 @@
563563
<artifactId>simpleclient</artifactId>
564564
<version>${prometheus.version}</version>
565565
</dependency>
566+
<dependency>
567+
<groupId>io.prometheus</groupId>
568+
<artifactId>simpleclient_caffeine</artifactId>
569+
<version>${prometheus.version}</version>
570+
</dependency>
566571
<dependency>
567572
<groupId>io.prometheus</groupId>
568573
<artifactId>simpleclient_common</artifactId>
569574
<version>${prometheus.version}</version>
570575
</dependency>
576+
<dependency>
577+
<groupId>io.prometheus</groupId>
578+
<artifactId>simpleclient_tracer_common</artifactId>
579+
<version>${prometheus.version}</version>
580+
</dependency>
581+
<dependency>
582+
<groupId>io.prometheus</groupId>
583+
<artifactId>simpleclient_tracer_otel</artifactId>
584+
<version>${prometheus.version}</version>
585+
</dependency>
586+
<dependency>
587+
<groupId>io.prometheus</groupId>
588+
<artifactId>simpleclient_tracer_otel_agent</artifactId>
589+
<version>${prometheus.version}</version>
590+
</dependency>
571591

572592
<!-- Quarkus core -->
573593

@@ -4386,6 +4406,11 @@
43864406
<artifactId>smallrye-fault-tolerance-api</artifactId>
43874407
<version>${smallrye-fault-tolerance.version}</version>
43884408
</dependency>
4409+
<dependency>
4410+
<groupId>io.smallrye</groupId>
4411+
<artifactId>smallrye-fault-tolerance-apiimpl</artifactId>
4412+
<version>${smallrye-fault-tolerance.version}</version>
4413+
</dependency>
43894414
<dependency>
43904415
<groupId>io.smallrye</groupId>
43914416
<artifactId>smallrye-fault-tolerance-autoconfig-core</artifactId>
@@ -4411,6 +4436,11 @@
44114436
<artifactId>smallrye-fault-tolerance-mutiny</artifactId>
44124437
<version>${smallrye-fault-tolerance.version}</version>
44134438
</dependency>
4439+
<dependency>
4440+
<groupId>io.smallrye</groupId>
4441+
<artifactId>smallrye-fault-tolerance-standalone</artifactId>
4442+
<version>${smallrye-fault-tolerance.version}</version>
4443+
</dependency>
44144444
<dependency>
44154445
<groupId>io.smallrye</groupId>
44164446
<artifactId>smallrye-fault-tolerance-tracing-propagation</artifactId>

core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ public static void run(Application application, Class<? extends QuarkusApplicati
164164
stateLock.unlock();
165165
}
166166
}
167-
} catch (Exception e) {
168-
Throwable rootCause = ExceptionUtil.getRootCause(e);
167+
} catch (Throwable t) {
168+
Throwable rootCause = ExceptionUtil.getRootCause(t);
169169
if (exitCodeHandler == null) {
170170
Logger applicationLogger = Logger.getLogger(Application.class);
171171
if (rootCause instanceof QuarkusBindException qbe) {
@@ -198,7 +198,7 @@ public static void run(Application application, Class<? extends QuarkusApplicati
198198
&& !StringUtil.isNullOrEmpty(rootCause.getMessage())) {
199199
System.err.println(rootCause.getMessage());
200200
} else {
201-
applicationLogger.errorv(e, "Failed to start application");
201+
applicationLogger.errorv(t, "Failed to start application");
202202
ensureConsoleLogsDrained();
203203
}
204204
}
@@ -214,7 +214,7 @@ public static void run(Application application, Class<? extends QuarkusApplicati
214214
? ((PreventFurtherStepsException) rootCause).getExitCode()
215215
: 1;
216216
currentApplication = null;
217-
(exitCodeHandler == null ? defaultExitCodeHandler : exitCodeHandler).accept(exceptionExitCode, e);
217+
(exitCodeHandler == null ? defaultExitCodeHandler : exitCodeHandler).accept(exceptionExitCode, t);
218218
return;
219219
} finally {
220220
try {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.quarkus.gradle;
2+
3+
import java.util.Objects;
4+
5+
import org.gradle.api.Named;
6+
7+
class NamedImpl implements Named {
8+
9+
private final String name;
10+
11+
public NamedImpl(String name) {
12+
this.name = Objects.requireNonNull(name);
13+
}
14+
15+
@Override
16+
public String getName() {
17+
return name;
18+
}
19+
}

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -471,39 +471,69 @@ public boolean isSatisfiedBy(Task t) {
471471

472472
tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME, JavaCompile.class,
473473
compileJava -> {
474+
// add the code gen sources
475+
final SourceSet generatedSourceSet = sourceSets
476+
.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
477+
addCodeGenSourceDirs(compileJava, generatedSourceSet, quarkusExt);
474478
// quarkusGenerateCode is a dependency
475479
compileJava.dependsOn(quarkusGenerateCode);
476480
// quarkusGenerateCodeDev must run before compileJava in case quarkusDev is the target
477481
compileJava.mustRunAfter(quarkusGenerateCodeDev);
478-
// add the code gen sources
479-
addCodeGenSourceDirs(compileJava,
480-
sourceSets.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES), quarkusExt);
482+
483+
// The code below needs to be reviewed. There is no test coverage for it.
484+
// We need to properly configure/use these tasks. For now they aren't actually used
485+
// but w/o the code below, in some cases, Gradle may fail on determining task ordering.
486+
// https://github.com/quarkusio/quarkus/issues/45057 states that this issue happens with
487+
// org.gradle.parallel=true when building from IntelliJ
488+
// Similar code is added for compileKotlin (although for Kotlin these task don't seem to exist).
489+
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
490+
compileJava.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
491+
}
481492
});
482493
tasks.named(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, JavaCompile.class,
483494
compileTestJava -> {
484-
compileTestJava.dependsOn(quarkusGenerateCode);
485-
compileTestJava.dependsOn(quarkusGenerateCodeTests);
495+
// add the code gen test sources
496+
final SourceSet generatedSourceSet = sourceSets
497+
.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
498+
addCodeGenSourceDirs(compileTestJava, generatedSourceSet, quarkusExt);
499+
compileTestJava.dependsOn(quarkusGenerateCode, quarkusGenerateCodeTests);
500+
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
501+
compileTestJava.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
502+
}
486503
if (project.getGradle().getStartParameter().getTaskNames().contains(QUARKUS_DEV_TASK_NAME)) {
487504
compileTestJava.getOptions().setFailOnError(false);
488505
}
489-
// add the code gen test sources
490-
addCodeGenSourceDirs(compileTestJava,
491-
sourceSets.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES), quarkusExt);
492506
});
493507
});
494508

495509
project.getPlugins().withId("org.jetbrains.kotlin.jvm", plugin -> {
496510
quarkusDev.configure(task -> task.shouldPropagateJavaCompilerArgs(false));
497511
tasks.named("compileKotlin", task -> {
498-
task.mustRunAfter(quarkusGenerateCode);
512+
final SourceSet generatedSourceSet = project.getExtensions().getByType(SourceSetContainer.class)
513+
.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
514+
addCodeGenSourceDirs(task, generatedSourceSet, quarkusExt);
515+
task.dependsOn(quarkusGenerateCode);
499516
task.mustRunAfter(quarkusGenerateCodeDev);
500-
addCodeGenSourceDirs(task, project.getExtensions().getByType(SourceSetContainer.class)
501-
.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES), quarkusExt);
517+
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
518+
task.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
519+
}
520+
String generatedSourcesCompileTaskName = generatedSourceSet.getCompileTaskName("kotlin");
521+
if (tasks.contains(new NamedImpl(generatedSourcesCompileTaskName))) {
522+
task.mustRunAfter(tasks.named(generatedSourcesCompileTaskName));
523+
}
502524
});
503525
tasks.named("compileTestKotlin", task -> {
526+
final SourceSet generatedSourceSet = project.getExtensions().getByType(SourceSetContainer.class)
527+
.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
528+
addCodeGenSourceDirs(task, generatedSourceSet, quarkusExt);
504529
task.dependsOn(quarkusGenerateCodeTests);
505-
addCodeGenSourceDirs(task, project.getExtensions().getByType(SourceSetContainer.class)
506-
.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES), quarkusExt);
530+
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
531+
task.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
532+
}
533+
final String generatedSourcesCompileTaskName = generatedSourceSet.getCompileTaskName("kotlin");
534+
if (tasks.contains(new NamedImpl(generatedSourcesCompileTaskName))) {
535+
task.mustRunAfter(tasks.named(generatedSourcesCompileTaskName));
536+
}
507537
});
508538
});
509539
}

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.quarkus.gradle.tasks;
22

3+
import static io.smallrye.config.ConfigMappings.ConfigClass.configClass;
34
import static java.util.Collections.emptyMap;
45
import static java.util.Collections.emptySet;
56
import static java.util.Collections.unmodifiableMap;
@@ -140,6 +141,8 @@ public Map<String, String> get() {
140141
properties.put(propertyName, configValue.getValue());
141142
}
142143
}
144+
configClass(PackageConfig.class).getProperties().keySet().forEach(properties::remove);
145+
configClass(NativeConfig.class).getProperties().keySet().forEach(properties::remove);
143146
return unmodifiableMap(properties);
144147
}
145148
});

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGenerateCode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ public Set<File> getInputDirectory() {
110110
@TaskAction
111111
public void generateCode() throws IOException {
112112
ApplicationModel appModel = ToolingUtils.deserializeAppModel(getApplicationModel().get().getAsFile().toPath());
113-
Map<String, String> configMap = effectiveProvider()
114-
.buildEffectiveConfiguration(appModel, new HashMap<>()).getOnlyQuarkusValues();
113+
Map<String, String> configMap = effectiveProvider().buildEffectiveConfiguration(appModel, new HashMap<>()).getValues();
115114

116115
File outputPath = getGeneratedOutputDirectory().get().getAsFile();
117116

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusGradleUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public static String getClassesDir(SourceSet sourceSet, File tmpDir, boolean pop
4646
}
4747

4848
public static Path mergeClassesDirs(Collection<Path> classesDirs, File tmpDir, boolean populated, boolean test) {
49-
List<Path> existingClassesDirs = classesDirs.stream().filter(p -> Files.exists(p)).toList();
49+
List<Path> existingClassesDirs = classesDirs.stream().filter(Files::exists).toList();
5050

51-
if (existingClassesDirs.size() == 0) {
51+
if (existingClassesDirs.isEmpty()) {
5252
return null;
5353
}
5454

devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/QuarkusComponentVariants.java

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,62 @@ private ConditionalDependency getOrCreateConditionalDep(Dependency dep) {
416416
key -> newConditionalDep(dep));
417417
}
418418

419+
private ResolvedArtifact tryResolvingRelocationArtifact(Dependency dep) {
420+
final Configuration configForRelocated = project.getConfigurations().detachedConfiguration(dep).setTransitive(true);
421+
setConditionalAttributes(configForRelocated, project, mode);
422+
423+
var firstLevelDeps = configForRelocated.getResolvedConfiguration().getFirstLevelModuleDependencies();
424+
if (firstLevelDeps.size() != 1) {
425+
return null;
426+
}
427+
ResolvedDependency resolvedDep = firstLevelDeps.iterator().next();
428+
429+
// If resolved dep is indeed relocated, it should have exactly one child and we assume
430+
// that child is the actual artifact we want.
431+
var childrenDeps = resolvedDep.getChildren();
432+
if (childrenDeps.size() != 1) {
433+
return null;
434+
}
435+
ResolvedDependency relocatedDep = childrenDeps.iterator().next();
436+
437+
var resolvedArtifacts = relocatedDep.getModuleArtifacts();
438+
if (resolvedArtifacts.size() != 1) {
439+
return null;
440+
}
441+
442+
ResolvedArtifact artifact = resolvedArtifacts.iterator().next();
443+
if (ArtifactCoords.TYPE_POM.equals(artifact.getExtension())) {
444+
return null;
445+
}
446+
447+
return artifact;
448+
}
449+
419450
private ConditionalDependency newConditionalDep(Dependency dep) {
420451
final Configuration config = project.getConfigurations().detachedConfiguration(dep).setTransitive(false);
421452
setConditionalAttributes(config, project, mode);
453+
ResolvedArtifact resolvedArtifact = null;
454+
422455
for (var a : config.getResolvedConfiguration().getResolvedArtifacts()) {
423-
return new ConditionalDependency(getKey(a), a, DependencyUtils.getExtensionInfoOrNull(project, a));
456+
resolvedArtifact = a;
457+
break;
458+
}
459+
460+
if (resolvedArtifact == null) {
461+
// likely a relocation artifact, in which case we want to resolve it with transitive deps and
462+
// take the first artifact.
463+
resolvedArtifact = tryResolvingRelocationArtifact(dep);
424464
}
425-
throw new RuntimeException(dep + " did not resolve to any artifacts");
465+
466+
if (resolvedArtifact == null) {
467+
throw new RuntimeException(dep + " did not resolve to any artifacts");
468+
}
469+
470+
return new ConditionalDependency(
471+
getKey(resolvedArtifact),
472+
resolvedArtifact,
473+
DependencyUtils.getExtensionInfoOrNull(project, resolvedArtifact));
474+
426475
}
427476

428477
private class ProcessedDependency {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ static void setProjectModels(QuarkusBootstrapMojo mojo, BootstrapMavenContextCon
110110
* @return raw POM
111111
*/
112112
private static Model getRawModel(MavenProject mp) {
113-
final Model model = mp.getOriginalModel();
113+
Model model = mp.getOriginalModel();
114114
if (model.getDependencyManagement() == null) {
115+
// clone the model to not modify the original model associated with the project,
116+
// otherwise, the enforcer plugin may fail, for example
117+
model = model.clone();
115118
// this could be the flatten plugin removing the dependencyManagement
116119
// in which case we set the effective dependency management to not lose the platform info
117120
model.setDependencyManagement(mp.getDependencyManagement());

docs/src/main/asciidoc/blaze-persistence.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add the following dependencies to your project:
5151
</dependency>
5252
<dependency>
5353
<groupId>com.blazebit</groupId>
54-
<artifactId>blaze-persistence-integration-hibernate-7.0</artifactId>
54+
<artifactId>blaze-persistence-integration-hibernate-7.1</artifactId>
5555
<scope>runtime</scope>
5656
</dependency>
5757
----
@@ -60,7 +60,7 @@ Add the following dependencies to your project:
6060
.Using Gradle
6161
----
6262
implementation("com.blazebit:blaze-persistence-integration-quarkus-3")
63-
runtimeOnly("com.blazebit:blaze-persistence-integration-hibernate-7.0")
63+
runtimeOnly("com.blazebit:blaze-persistence-integration-hibernate-7.1")
6464
----
6565

6666
The use in native images requires a dependency on the entity view annotation processor that may be extracted into a separate `native` profile:

0 commit comments

Comments
 (0)