Skip to content

Commit

Permalink
Merge pull request #22482 from gsmet/2.6.1-backports-1
Browse files Browse the repository at this point in the history
2.6.1 backports 1
  • Loading branch information
gsmet authored Dec 22, 2021
2 parents 7ff322c + 42bd800 commit 3f1148d
Show file tree
Hide file tree
Showing 144 changed files with 2,111 additions and 355 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 @@ -454,7 +454,7 @@ jobs:
name: "build-reports-Gradle Tests - JDK ${{matrix.java.name}}"
path: |
**/build/test-results/test/TEST-*.xml
**/target/**
**/target/*-reports/TEST-*.xml
target/build-report.json
LICENSE.txt
retention-days: 2
Expand Down
37 changes: 5 additions & 32 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<hibernate-search.version>6.0.7.Final</hibernate-search.version>
<narayana.version>5.12.4.Final</narayana.version>
<jboss-transaction-api_1.2_spec.version>1.1.1.Final</jboss-transaction-api_1.2_spec.version>
<agroal.version>1.13</agroal.version>
<agroal.version>1.14</agroal.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
<elasticsearch-rest-client.version>7.10.0</elasticsearch-rest-client.version>
<rxjava.version>2.2.21</rxjava.version>
Expand Down Expand Up @@ -128,7 +128,7 @@
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<testng.version>6.14.2</testng.version>
<assertj.version>3.21.0</assertj.version>
<infinispan.version>13.0.0.Final</infinispan.version>
<infinispan.version>13.0.5.Final</infinispan.version>
<infinispan.protostream.version>4.4.1.Final</infinispan.protostream.version>
<caffeine.version>2.9.3</caffeine.version>
<netty.version>4.1.72.Final</netty.version>
Expand All @@ -142,7 +142,7 @@
<scala.version>2.12.13</scala.version>
<aws-lambda-java.version>1.2.1</aws-lambda-java.version>
<aws-lambda-java-events.version>3.11.0</aws-lambda-java-events.version>
<aws-lambda-serverless-java-container.version>1.6</aws-lambda-serverless-java-container.version>
<aws-lambda-serverless-java-container.version>1.6.1</aws-lambda-serverless-java-container.version>
<aws-xray.version>2.10.0</aws-xray.version>
<azure-functions-java-library.version>1.4.2</azure-functions-java-library.version>
<kotlin.version>1.6.10</kotlin.version>
Expand Down Expand Up @@ -184,8 +184,8 @@
<commons-compress.version>1.21</commons-compress.version>
<gson.version>2.8.6</gson.version>
<webjars-locator-core.version>0.46</webjars-locator-core.version>
<log4j2-jboss-logmanager.version>1.0.0.Final</log4j2-jboss-logmanager.version>
<log4j2-api.version>2.16.0</log4j2-api.version>
<log4j2-jboss-logmanager.version>1.1.1.Final</log4j2-jboss-logmanager.version>
<log4j2-api.version>2.17.0</log4j2-api.version>
<log4j-jboss-logmanager.version>1.2.2.Final</log4j-jboss-logmanager.version>
<avro.version>1.11.0</avro.version>
<apicurio-registry.version>2.1.3.Final</apicurio-registry.version>
Expand Down Expand Up @@ -4817,33 +4817,6 @@
<version>${azure-functions-java-library.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-artifact-transfer</artifactId>
<version>${maven-artifact-transfer.version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.8.4</proposed-maven-version>
<maven-wrapper.version>0.7.7</maven-wrapper.version>
<gradle-wrapper.version>7.3.1</gradle-wrapper.version>
<gradle-wrapper.version>7.3.2</gradle-wrapper.version>
<quarkus-gradle-plugin.version>${project.version}</quarkus-gradle-plugin.version>
<quarkus-maven-plugin.version>${project.version}</quarkus-maven-plugin.version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.maven.dependency.ArtifactKey;
import io.quarkus.maven.dependency.GACT;

public final class RemovedResourceBuildItem extends MultiBuildItem {

private final ArtifactKey artifact;
private final GACT artifact;
private final Set<String> resources;

@Deprecated
public RemovedResourceBuildItem(ArtifactKey artifact, Set<String> resources) {
this.artifact = new GACT(artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), artifact.getType());
this.resources = resources;
}

public RemovedResourceBuildItem(GACT artifact, Set<String> resources) {
this.artifact = artifact;
this.resources = resources;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ public List<String> toList() {

flagList.addAll(effectiveDefaultFlags);

// Add --release and -source and -target flags.
// Prefer --release over -source and -target flags to make sure to not run into:
// "error: option --source cannot be used together with --release"
// This is *not* checking defaultFlags; it is not expected that defaultFlags ever contain --release etc.!
if (releaseJavaVersion != null) {
flagList.add("--release");
flagList.add(releaseJavaVersion);
}
if (sourceJavaVersion != null) {
flagList.add("-source");
flagList.add(sourceJavaVersion);
}
if (targetJavaVersion != null) {
flagList.add("-target");
flagList.add(targetJavaVersion);
} else {
if (sourceJavaVersion != null) {
flagList.add("-source");
flagList.add(sourceJavaVersion);
}
if (targetJavaVersion != null) {
flagList.add("-target");
flagList.add(targetJavaVersion);
}
}

flagList.addAll(userFlags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,17 +501,19 @@ private DiscoveryResult discoverTestClasses() {

//we also only run tests from the current module, which we can also revisit later
Indexer indexer = new Indexer();
try (Stream<Path> files = Files.walk(Paths.get(moduleInfo.getTest().get().getClassesPath()))) {
files.filter(s -> s.getFileName().toString().endsWith(".class")).forEach(s -> {
try (InputStream in = Files.newInputStream(s)) {
indexer.index(in);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
moduleInfo.getTest().ifPresent(test -> {
try (Stream<Path> files = Files.walk(Paths.get(test.getClassesPath()))) {
files.filter(s -> s.getFileName().toString().endsWith(".class")).forEach(s -> {
try (InputStream in = Files.newInputStream(s)) {
indexer.index(in);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
});

Index index = indexer.complete();
//we now have all the classes by name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ public void init() {

try {
Set<Path> paths = new LinkedHashSet<>();
paths.add(Paths.get(module.getTest().get().getClassesPath()));
if (module.getTest().get().getResourcesOutputPath() != null) {
paths.add(Paths.get(module.getTest().get().getResourcesOutputPath()));
}
module.getTest().ifPresent(test -> {
paths.add(Paths.get(test.getClassesPath()));
if (test.getResourcesOutputPath() != null) {
paths.add(Paths.get(test.getResourcesOutputPath()));
}
});
if (mainModule) {
paths.addAll(curatedApplication.getQuarkusBootstrap().getApplicationRoot().toList());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class FSWatchUtil {
*/
public void observe(Collection<Watcher> watchers,
long intervalMs) {
if (watchers.isEmpty()) {
return;
}

ThreadFactory tf = (Runnable r) -> new Thread(r, "FSWatchUtil");
ExecutorService executorService = Executors.newSingleThreadExecutor(tf);
executorService.execute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,26 @@ void sourceAndTarget() {
new CompilerFlags(setOf(), listOf("-target", "3"), null, null, null)),
() -> assertEquals(
new CompilerFlags(setOf(), listOf(), "1", "2", "3"),
new CompilerFlags(setOf(), listOf("--release", "1", "-source", "2", "-target", "3"), null, null, null)),
new CompilerFlags(setOf(), listOf("--release", "1"), null, null, null)),
() -> assertEquals(
new CompilerFlags(setOf(), listOf(), null, "2", "3"),
new CompilerFlags(setOf(), listOf("-source", "2", "-target", "3"), null, null, null)),
() -> assertEquals(
new CompilerFlags(setOf(), listOf("--release", "4", "-source", "5", "-target", "6"), "1", "2", "3"),
new CompilerFlags(setOf(), listOf("--release", "1", "-source", "2", "-target", "3", "--release", "4",
"-source", "5", "-target", "6"), null, null, null)));
new CompilerFlags(setOf(), listOf("-source", "5", "-target", "6"), null, "2", "3"),
new CompilerFlags(setOf(), listOf("-source", "2", "-target", "3", "-source", "5", "-target", "6"),
null, null, null)));
}

@Test
void allFeatures() {
assertAll(
() -> assertEquals(
new CompilerFlags(setOf("-b", "-c", "-d"), listOf("-a", "-b", "-c"), "1", "2", "3"),
new CompilerFlags(setOf(),
listOf("-d", "--release", "1", "-source", "2", "-target", "3", "-a", "-b", "-c"),
new CompilerFlags(setOf(), listOf("-d", "--release", "1", "-a", "-b", "-c"), null, null, null)));
assertAll(
() -> assertEquals(
new CompilerFlags(setOf("-b", "-c", "-d"), listOf("-a", "-b", "-c"), null, "2", "3"),
new CompilerFlags(setOf(), listOf("-d", "-source", "2", "-target", "3", "-a", "-b", "-c"),
null, null, null)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public abstract class QuarkusConsole {
public final static PrintStream ORIGINAL_OUT = System.out;
public final static PrintStream ORIGINAL_ERR = System.err;

public static PrintStream REDIRECT_OUT = null;
public static PrintStream REDIRECT_ERR = null;

public synchronized static void installRedirects() {
if (redirectsInstalled) {
return;
Expand All @@ -62,8 +65,31 @@ public synchronized static void installRedirects() {
//force console init
//otherwise you can get a stack overflow as it sees the redirected output
QuarkusConsole.INSTANCE.isInputSupported();
System.setOut(new RedirectPrintStream(false));
System.setErr(new RedirectPrintStream(true));
REDIRECT_OUT = new RedirectPrintStream(false);
REDIRECT_ERR = new RedirectPrintStream(true);
System.setOut(REDIRECT_OUT);
System.setErr(REDIRECT_ERR);
}

public synchronized static void uninstallRedirects() {
if (!redirectsInstalled) {
return;
}

if (REDIRECT_OUT != null) {
REDIRECT_OUT.flush();
REDIRECT_OUT.close();
REDIRECT_OUT = null;
}
if (REDIRECT_ERR != null) {
REDIRECT_ERR.flush();
REDIRECT_ERR.close();
REDIRECT_ERR = null;
}
System.setOut(ORIGINAL_OUT);
System.setErr(ORIGINAL_ERR);

redirectsInstalled = false;
}

public static boolean hasColorSupport() {
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,8 @@ private static List<ExtensionCatalog> getRecommendedOrigins(ExtensionCatalog ext
for (Extension e : extensions) {
addOrigins(extOrigins, e);
}
final OriginSelector os = new OriginSelector(extOrigins);
os.calculateCompatibleCombinations();

final OriginCombination recommendedCombination = os.getRecommendedCombination();
final OriginCombination recommendedCombination = OriginSelector.of(extOrigins).calculateRecommendedCombination();
if (recommendedCombination == null) {
final StringBuilder buf = new StringBuilder();
buf.append("Failed to determine a compatible Quarkus version for the requested extensions: ");
Expand Down
12 changes: 7 additions & 5 deletions docs/src/main/asciidoc/amazon-lambda.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,17 @@ jar tvf target/function.zip

== Amazon Alexa Integration

To use Alexa with Quarkus native, please add the following extension.
To use Alexa with Quarkus native, you need to use the https://github.com/quarkiverse/quarkus-amazon-alexa[Quarkus Amazon Alexa extension hosted at the Quarkiverse Hub].

[source,xml]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-amazon-alexa</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.alexa</groupId>
<artifactId>quarkus-amazon-alexa</artifactId>
<version>${quarkus-amazon-alexa.version}</version> <1>
</dependency>
----
<1> Define the latest version of the extension in your POM file.

Create your Alexa handler, as normal, by sub-classing the abstract `com.amazon.ask.SkillStreamHandler`, and add your request handler implementation.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ remove duplicates. If you want to only enable a test resource on a single test c

Quarkus provides a few implementations of `QuarkusTestResourceLifecycleManager` out of the box (see `io.quarkus.test.h2.H2DatabaseTestResource` which starts an H2 database, or `io.quarkus.test.kubernetes.client.KubernetesServerTestResource` which starts a mock Kubernetes API server),
but it is common to create custom implementations to address specific application needs.
Common cases include starting docker containers using https://www.testcontainers.org/[Testcontainers] (an example of which can be found https://github.com/quarkusio/quarkus-quickstarts/blob/main/security-keycloak-authorization-quickstart/src/test/java/org/acme/security/keycloak/authorization/KeycloakServer.java[here]),
Common cases include starting docker containers using https://www.testcontainers.org/[Testcontainers] (an example of which can be found https://github.com/quarkusio/quarkus/blob/main/test-framework/keycloak-server/src/main/java/io/quarkus/test/keycloak/server/KeycloakTestResourceLifecycleManager.java[here]),
or starting a mock HTTP server using http://wiremock.org/[Wiremock] (an example of which can be found https://github.com/geoand/quarkus-test-demo/blob/main/src/test/java/org/acme/getting/started/country/WiremockCountries.java[here]).


Expand Down
Loading

0 comments on commit 3f1148d

Please sign in to comment.