Skip to content

Commit

Permalink
Merge branch 'main' into fix-resteasy-client-subresources
Browse files Browse the repository at this point in the history
  • Loading branch information
maxr2011-tech11 authored Sep 2, 2024
2 parents a7c7f39 + b702e31 commit e0f3a31
Show file tree
Hide file tree
Showing 55 changed files with 442 additions and 235 deletions.
1 change: 0 additions & 1 deletion .mvn/maven.config

This file was deleted.

6 changes: 3 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<microprofile-jwt.version>2.1</microprofile-jwt.version>
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.5.0</smallrye-common.version>
<smallrye-common.version>2.6.0</smallrye-common.version>
<smallrye-config.version>3.9.1</smallrye-config.version>
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
Expand Down Expand Up @@ -95,7 +95,7 @@
<gizmo.version>1.8.0</gizmo.version>
<jackson-bom.version>2.17.2</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>
<commons-lang3.version>3.17.0</commons-lang3.version>
<commons-codec.version>1.17.1</commons-codec.version>
<classmate.version>1.7.0</classmate.version>
<!-- See root POM for hibernate-orm.version, hibernate-reactive.version, hibernate-validator.version,
Expand Down Expand Up @@ -174,7 +174,7 @@
<javaparser.version>3.26.1</javaparser.version>
<hibernate-quarkus-local-cache.version>0.3.0</hibernate-quarkus-local-cache.version>
<flapdoodle.mongo.version>4.17.0</flapdoodle.mongo.version>
<quarkus-spring-api.version>6.1.SP2</quarkus-spring-api.version>
<quarkus-spring-api.version>6.1.SP3</quarkus-spring-api.version>
<quarkus-spring-data-api.version>3.2.SP2</quarkus-spring-data-api.version>
<quarkus-spring-security-api.version>6.2</quarkus-spring-security-api.version>
<quarkus-spring-boot-api.version>3.2</quarkus-spring-boot-api.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ void miscSetup(
Consumer<ServiceProviderBuildItem> provider) {
runtimeInit.accept(new RuntimeReinitializedClassBuildItem(ConsoleHandler.class.getName()));
runtimeInit.accept(new RuntimeReinitializedClassBuildItem("io.smallrye.common.ref.References$ReaperThread"));
runtimeInit.accept(new RuntimeReinitializedClassBuildItem("io.smallrye.common.os.Process"));
systemProp
.accept(new NativeImageSystemPropertyBuildItem("java.util.logging.manager", "org.jboss.logmanager.LogManager"));
provider.accept(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected NativeImageBuildContainerRunner(NativeConfig nativeConfig) {

this.baseContainerRuntimeArgs = new String[] { "--env", "LANG=C", "--rm" };

containerName = "build-native-" + RandomStringUtils.random(5, true, false);
containerName = "build-native-" + RandomStringUtils.insecure().next(5, true, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public NativeImageRunnerBuildItem resolveNativeImageBuildRunner(NativeConfig nat
}
String executableName = getNativeImageExecutableName();
String errorMessage = "Cannot find the `" + executableName
+ "` in the GRAALVM_HOME, JAVA_HOME and System PATH. Install it using `gu install native-image`";
+ "` in the GRAALVM_HOME, JAVA_HOME and System PATH. Install it using `gu install native-image`.";
if (!SystemUtils.IS_OS_LINUX) {
// Delay the error: if we're just building native sources, we may not need the build runner at all.
return new NativeImageRunnerBuildItem(new NativeImageBuildRunnerError(errorMessage));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private boolean runUpxInContainer(NativeImageBuildItem nativeImage, NativeConfig
commandLine.add("--rm");
commandLine.add("--entrypoint=upx");

String containerName = "upx-" + RandomStringUtils.random(5, true, false);
String containerName = "upx-" + RandomStringUtils.insecure().next(5, true, false);
commandLine.add("--name");
commandLine.add(containerName);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
package io.quarkus.deployment.steps;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.concurrent.atomic.AtomicReference;

import org.jboss.logging.Logger;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.pkg.builditem.BuildSystemTargetBuildItem;
import io.quarkus.deployment.pkg.builditem.CompiledJavaVersionBuildItem;
import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
import io.quarkus.maven.dependency.DependencyFlags;
import io.quarkus.maven.dependency.ResolvedDependency;

public class CompiledJavaVersionBuildStep {

Expand All @@ -26,44 +23,49 @@ public class CompiledJavaVersionBuildStep {
* application .class file that is found
*/
@BuildStep
public CompiledJavaVersionBuildItem compiledJavaVersion(BuildSystemTargetBuildItem buildSystemTarget) {
if ((buildSystemTarget.getOutputDirectory() == null) || (!Files.exists(buildSystemTarget.getOutputDirectory()))) {
log.debug("Skipping because output directory does not exist");
// needed for Arquillian TCK tests
return CompiledJavaVersionBuildItem.unknown();
}
AtomicReference<Integer> majorVersion = new AtomicReference<>(null);
try {
log.debugf("Walking directory '%s'", buildSystemTarget.getOutputDirectory().toAbsolutePath().toString());
Files.walkFileTree(buildSystemTarget.getOutputDirectory(), new SimpleFileVisitor<>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
if (file.getFileName().toString().endsWith(".class")) {
log.debugf("Checking file '%s'", file.toAbsolutePath().toString());
try (InputStream in = new FileInputStream(file.toFile())) {
DataInputStream data = new DataInputStream(in);
if (0xCAFEBABE == data.readInt()) {
data.readUnsignedShort(); // minor version -> we don't care about it
int v = data.readUnsignedShort();
majorVersion.set(v);
log.debugf("Determined compile java version to be %d", v);
return FileVisitResult.TERMINATE;
}
} catch (IOException e) {
log.debugf(e, "Encountered exception while processing file '%s'", file.toAbsolutePath().toString());
}
}
// if this was not .class file or there was an error parsing its contents, we continue on to the next file
return FileVisitResult.CONTINUE;
public CompiledJavaVersionBuildItem compiledJavaVersion(CurateOutcomeBuildItem curateOutcomeBuildItem) {
final ResolvedDependency appArtifact = curateOutcomeBuildItem.getApplicationModel().getAppArtifact();
Integer majorVersion = getMajorJavaVersion(appArtifact);
if (majorVersion == null) {
// workspace info isn't available in prod builds though
for (ResolvedDependency module : curateOutcomeBuildItem.getApplicationModel()
.getDependencies(DependencyFlags.WORKSPACE_MODULE)) {
majorVersion = getMajorJavaVersion(module);
if (majorVersion != null) {
break;
}
});
} catch (IOException ignored) {

}
}
if (majorVersion.get() == null) {
if (majorVersion == null) {
log.debug("No .class files located");
return CompiledJavaVersionBuildItem.unknown();
}
return CompiledJavaVersionBuildItem.fromMajorJavaVersion(majorVersion.get());
return CompiledJavaVersionBuildItem.fromMajorJavaVersion(majorVersion);
}

private static Integer getMajorJavaVersion(ResolvedDependency artifact) {
final AtomicReference<Integer> majorVersion = new AtomicReference<>(null);
artifact.getContentTree().walk(visit -> {
final Path file = visit.getPath();
if (file.getFileName() == null) {
// this can happen if it's the root of a JAR
return;
}
if (file.getFileName().toString().endsWith(".class") && !Files.isDirectory(file)) {
log.debugf("Checking file '%s'", file.toAbsolutePath().toString());
try (DataInputStream data = new DataInputStream(Files.newInputStream(file))) {
if (0xCAFEBABE == data.readInt()) {
data.readUnsignedShort(); // minor version -> we don't care about it
int v = data.readUnsignedShort();
majorVersion.set(v);
log.debugf("Determined compile java version to be %d", v);
visit.stopWalking();
}
} catch (IOException e) {
log.debugf(e, "Encountered exception while processing file '%s'", file.toAbsolutePath().toString());
}
}
});
return majorVersion.get();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.annotation.processor.documentation.config.discovery;

import io.quarkus.annotation.processor.documentation.config.model.Deprecation;
import io.quarkus.annotation.processor.documentation.config.model.SourceType;
import io.quarkus.annotation.processor.documentation.config.util.TypeUtil;
import io.quarkus.annotation.processor.util.Strings;

Expand All @@ -8,9 +10,10 @@ public class DiscoveryConfigProperty {
private final String path;
private final String sourceClass;
private final String sourceName;
private final SourceType sourceType;
private final String defaultValue;
private final String defaultValueForDoc;
private final boolean deprecated;
private final Deprecation deprecation;
private final String mapKey;
private final boolean unnamedMapKey;
private final ResolvedType type;
Expand All @@ -19,16 +22,18 @@ public class DiscoveryConfigProperty {
private final boolean section;
private final boolean sectionGenerated;

public DiscoveryConfigProperty(String path, String sourceClass, String sourceName, String defaultValue,
String defaultValueForDoc, boolean deprecated, String mapKey, boolean unnamedMapKey,
public DiscoveryConfigProperty(String path, String sourceClass, String sourceName, SourceType sourceType,
String defaultValue,
String defaultValueForDoc, Deprecation deprecation, String mapKey, boolean unnamedMapKey,
ResolvedType type, boolean converted, boolean enforceHyphenateEnumValue,
boolean section, boolean sectionGenerated) {
this.path = path;
this.sourceClass = sourceClass;
this.sourceName = sourceName;
this.sourceType = sourceType;
this.defaultValue = defaultValue;
this.defaultValueForDoc = defaultValueForDoc;
this.deprecated = deprecated;
this.deprecation = deprecation;
this.mapKey = mapKey;
this.unnamedMapKey = unnamedMapKey;
this.type = type;
Expand All @@ -50,6 +55,10 @@ public String getSourceName() {
return sourceName;
}

public SourceType getSourceType() {
return sourceType;
}

public String getDefaultValue() {
return defaultValue;
}
Expand All @@ -58,8 +67,12 @@ public String getDefaultValueForDoc() {
return defaultValueForDoc;
}

public Deprecation getDeprecation() {
return deprecation;
}

public boolean isDeprecated() {
return deprecated;
return deprecation != null;
}

public String getMapKey() {
Expand Down Expand Up @@ -106,7 +119,7 @@ public String toString(String prefix) {
if (defaultValueForDoc != null) {
sb.append(prefix + "defaultValueForDoc = " + defaultValueForDoc + "\n");
}
if (deprecated) {
if (deprecation != null) {
sb.append(prefix + "deprecated = true\n");
}
if (mapKey != null) {
Expand All @@ -122,29 +135,31 @@ public String toString(String prefix) {
return sb.toString();
}

public static Builder builder(String sourceClass, String sourceName, ResolvedType type) {
return new Builder(sourceClass, sourceName, type);
public static Builder builder(String sourceClass, String sourceName, SourceType sourceType, ResolvedType type) {
return new Builder(sourceClass, sourceName, sourceType, type);
}

public static class Builder {

private String name;
private final String sourceClass;
private final String sourceName;
private final SourceType sourceType;
private final ResolvedType type;
private String defaultValue;
private String defaultValueForDoc;
private boolean deprecated = false;
private Deprecation deprecation;
private String mapKey;
private boolean unnamedMapKey = false;
private boolean converted = false;
private boolean enforceHyphenateEnumValue = false;
private boolean section = false;
private boolean sectionGenerated = false;

public Builder(String sourceClass, String sourceName, ResolvedType type) {
public Builder(String sourceClass, String sourceName, SourceType sourceType, ResolvedType type) {
this.sourceClass = sourceClass;
this.sourceName = sourceName;
this.sourceType = sourceType;
this.type = type;
}

Expand All @@ -163,8 +178,8 @@ public Builder defaultValueForDoc(String defaultValueForDoc) {
return this;
}

public Builder deprecated() {
this.deprecated = true;
public Builder deprecated(String since, String replacement, String reason) {
this.deprecation = new Deprecation(since, replacement, reason);
return this;
}

Expand Down Expand Up @@ -202,8 +217,8 @@ public DiscoveryConfigProperty build() {
defaultValue = TypeUtil.normalizeDurationValue(defaultValue);
}

return new DiscoveryConfigProperty(name, sourceClass, sourceName, defaultValue, defaultValueForDoc, deprecated,
mapKey, unnamedMapKey, type, converted, enforceHyphenateEnumValue, section, sectionGenerated);
return new DiscoveryConfigProperty(name, sourceClass, sourceName, sourceType, defaultValue, defaultValueForDoc,
deprecation, mapKey, unnamedMapKey, type, converted, enforceHyphenateEnumValue, section, sectionGenerated);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.quarkus.annotation.processor.documentation.config.discovery;

public record ParsedJavadoc(String description, String since, JavadocFormat originalFormat) {
public record ParsedJavadoc(String description, String since, String deprecated, JavadocFormat originalFormat) {

public static ParsedJavadoc empty() {
return new ParsedJavadoc(null, null, null);
return new ParsedJavadoc(null, null, null, null);
}

public boolean isEmpty() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package io.quarkus.annotation.processor.documentation.config.discovery;

public record ParsedJavadocSection(String title, String details) {
public record ParsedJavadocSection(String title, String details, String deprecated) {

public static ParsedJavadocSection empty() {
return new ParsedJavadocSection(null, null, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public final String toString() {
return unwrappedType.toString();
}

public static ResolvedType ofPrimitive(TypeMirror unwrappedType) {
String primitiveName = unwrappedType.toString();

return new ResolvedType(unwrappedType, unwrappedType, primitiveName, primitiveName, primitiveName, true, false, false,
public static ResolvedType ofPrimitive(TypeMirror unwrappedType, String typeName) {
return new ResolvedType(unwrappedType, unwrappedType, typeName, typeName, typeName, true, false, false,
false, false, false, false, false, false, false);
}

Expand Down
Loading

0 comments on commit e0f3a31

Please sign in to comment.