From d7d326201cbe0fa64ae857614deb89112cfcc7b9 Mon Sep 17 00:00:00 2001
From: Adler Fleurant <2609856+AdlerFleurant@users.noreply.github.com>
Date: Tue, 20 Sep 2022 10:33:54 -0400
Subject: [PATCH] Avoid using non existing maven settings
Null check on mavenSettings.
Do not pass non-existent maven settings file to surefire and failsafe plugin.
Fix nearby typos and deprecated API usage.
Use ci settings.xml full path.
Fixes #28090
---
.github/workflows/ci-actions-incremental.yml | 4 +--
.github/workflows/ci-actions.yml.disabled | 16 ++++-----
.github/workflows/ci-fork-mvn-cache.yml | 2 +-
.github/workflows/codeql-analysis.yml | 2 +-
.github/workflows/deploy-snapshots.yml | 2 +-
.github/workflows/doc-build.yml | 4 +--
.github/workflows/jakarta-rewrite.yml | 2 +-
.github/workflows/jdk-early-access-build.yml | 2 +-
.../workflows/native-cron-build.yml.disabled | 2 +-
.github/workflows/release-build.yml | 2 +-
.github/workflows/sonarcloud.yml | 2 +-
build-parent/pom.xml | 36 +++++++++++++++++--
.../main/java/io/quarkus/runtime/Quarkus.java | 3 +-
.../quarkus/cli/CliCreateExtensionTest.java | 16 ++++-----
.../test/java/io/quarkus/cli/CliDriver.java | 15 ++++----
.../io/quarkus/cli/CliProjectGradleTest.java | 8 ++---
.../io/quarkus/cli/CliProjectMavenTest.java | 6 ++--
.../cli/RegistryClientBuilderTestBase.java | 4 ++-
18 files changed, 81 insertions(+), 47 deletions(-)
diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml
index eb5f7157ff8be8..62525f777603bc 100644
--- a/.github/workflows/ci-actions-incremental.yml
+++ b/.github/workflows/ci-actions-incremental.yml
@@ -42,7 +42,7 @@ concurrency:
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
- COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end"
+ COMMON_MAVEN_ARGS: "-e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml --fail-at-end"
NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs"
JVM_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dformat.skip -DskipDocs -Dquarkus.test.hang-detection-timeout=60"
DB_USER: hibernate_orm_test
@@ -606,7 +606,7 @@ jobs:
run: |
git clone https://github.com/quarkusio/quarkus-quickstarts.git && cd quarkus-quickstarts
git checkout development
- export LANG=en_US && ./mvnw -e -B -fae --settings .github/mvn-settings.xml clean verify -DskipTests
+ export LANG=en_US && ./mvnw -e -B -fae --settings ${{ github.workspace }}/.github/mvn-settings.xml clean verify -DskipTests
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
diff --git a/.github/workflows/ci-actions.yml.disabled b/.github/workflows/ci-actions.yml.disabled
index 6dfc23395335a5..cb92ae8c2b16bb 100644
--- a/.github/workflows/ci-actions.yml.disabled
+++ b/.github/workflows/ci-actions.yml.disabled
@@ -37,8 +37,8 @@ concurrency:
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
- NATIVE_TEST_MAVEN_OPTS: "-B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dtest-containers -Dstart-containers -Dnative-image.xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs"
- JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-containers -Dstart-containers -Dformat.skip -DskipDocs"
+ NATIVE_TEST_MAVEN_OPTS: "-B --settings ${{ github.workspace }}/.github/mvn-settings.xml --fail-at-end -Dquarkus.native.container-build=true -Dtest-containers -Dstart-containers -Dnative-image.xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs"
+ JVM_TEST_MAVEN_OPTS: "-e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -Dtest-containers -Dstart-containers -Dformat.skip -DskipDocs"
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_NAME: hibernate_orm_test
@@ -95,11 +95,11 @@ jobs:
key: q2maven-${{ steps.get-date.outputs.date }}
- name: Build
run: |
- ./mvnw -T1C -e -B -DskipTests -DskipITs -Dinvoker.skip -Dno-format -Dtcks --settings .github/mvn-settings.xml clean install
+ ./mvnw -T1C -e -B -DskipTests -DskipITs -Dinvoker.skip -Dno-format -Dtcks --settings ${{ github.workspace }}/.github/mvn-settings.xml clean install
- name: Verify extension dependencies
shell: bash
run: |
- ./update-extension-dependencies.sh -B --settings .github/mvn-settings.xml
+ ./update-extension-dependencies.sh -B --settings ${{ github.workspace }}/.github/mvn-settings.xml
if [ `git status -s -u no '*pom.xml' | wc -l` -ne 0 ]
then
echo -e '\033[0;31mError:\033[0m Dependencies to extension artifacts are outdated! Run ./update-extension-dependencies.sh and add the modified pom.xml files to your commit.' 1>&2
@@ -215,7 +215,7 @@ jobs:
run: tar -xzf maven-repo.tgz -C ~
- name: Build with Maven
shell: bash
- run: ./mvnw -B --settings .github/mvn-settings.xml -DskipDocs -Dformat.skip -pl !integration-tests/gradle -pl !integration-tests/maven -pl !integration-tests/devtools install
+ run: ./mvnw -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -DskipDocs -Dformat.skip -pl !integration-tests/gradle -pl !integration-tests/maven -pl !integration-tests/devtools install
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
@@ -498,10 +498,10 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Run RESTEasy Reactive TCK
- run: mvn -B --settings ../tcks/.github/mvn-settings.xml install
+ run: mvn -B --settings ../tcks/${{ github.workspace }}/.github/mvn-settings.xml install
working-directory: ./resteasy-reactive-testsuite
- name: Verify with Maven
- run: ../mvnw -B --settings .github/mvn-settings.xml -f tcks/pom.xml install
+ run: ../mvnw -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -f tcks/pom.xml install
working-directory: ./tcks
- name: Prepare failure archive (if maven failed)
if: failure()
@@ -576,7 +576,7 @@ jobs:
# done because there is no good way to pass strings with empty values to the previous command
# so this hack is as good as any
if [ "$CATEGORY" == "Misc1" ]; then
- ./mvnw -Dnative -Dquarkus.native.container-build=true -B --settings .github/mvn-settings.xml -f 'integration-tests/simple with space/' verify
+ ./mvnw -Dnative -Dquarkus.native.container-build=true -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -f 'integration-tests/simple with space/' verify
fi
- name: Prepare failure archive (if maven failed)
if: failure()
diff --git a/.github/workflows/ci-fork-mvn-cache.yml b/.github/workflows/ci-fork-mvn-cache.yml
index c048951db82f46..d65f26b6de8233 100644
--- a/.github/workflows/ci-fork-mvn-cache.yml
+++ b/.github/workflows/ci-fork-mvn-cache.yml
@@ -60,7 +60,7 @@ jobs:
key: q2maven-${{ steps.get-date.outputs.date }}
- name: Build
run: |
- ./mvnw -T1C -e -B --settings .github/mvn-settings.xml -Dquickly-ci -Dtcks clean install
+ ./mvnw -T1C -e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -Dquickly-ci -Dtcks clean install
- name: Delete Local Artifacts From Cache
shell: bash
run: rm -r ~/.m2/repository/io/quarkus
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 4a149f3cf8371a..dae7284835f847 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -52,7 +52,7 @@ jobs:
- if: matrix.language == 'java'
name: Build Java
- run: ./mvnw -B --settings .github/mvn-settings.xml -Dquickly-ci install
+ run: ./mvnw -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -Dquickly-ci install
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/deploy-snapshots.yml b/.github/workflows/deploy-snapshots.yml
index a334168533a175..8aa77db0eaafda 100644
--- a/.github/workflows/deploy-snapshots.yml
+++ b/.github/workflows/deploy-snapshots.yml
@@ -43,7 +43,7 @@ jobs:
SERVER_USERNAME: ${{ secrets.SERVER_USERNAME }}
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
run: |
- ./mvnw -e -B --settings .github/mvn-settings.xml \
+ ./mvnw -e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml \
-DskipTests -DskipITs -Dno-format -Dinvoker.skip=true \
-DretryFailedDeploymentCount=10 \
-pl !integration-tests/gradle \
diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml
index 321121daa14be2..8eaa59108157b7 100644
--- a/.github/workflows/doc-build.yml
+++ b/.github/workflows/doc-build.yml
@@ -52,8 +52,8 @@ jobs:
key: q2maven-doc-${{ steps.get-date.outputs.date }}
- name: Build
run: |
- ./mvnw -Dquickly-ci -B -DskipDocs=false --settings .github/mvn-settings.xml install
+ ./mvnw -Dquickly-ci -B -DskipDocs=false --settings ${{ github.workspace }}/.github/mvn-settings.xml install
- name: Build Docs
run: |
- ./mvnw -e -B --settings .github/mvn-settings.xml clean org.asciidoctor:asciidoctor-maven-plugin:process-asciidoc -pl docs -Ddocumentation-pdf
+ ./mvnw -e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml clean org.asciidoctor:asciidoctor-maven-plugin:process-asciidoc -pl docs -Ddocumentation-pdf
diff --git a/.github/workflows/jakarta-rewrite.yml b/.github/workflows/jakarta-rewrite.yml
index 7f946fe3583574..764e23d10078eb 100644
--- a/.github/workflows/jakarta-rewrite.yml
+++ b/.github/workflows/jakarta-rewrite.yml
@@ -43,7 +43,7 @@ jobs:
SERVER_USERNAME: ${{ secrets.SERVER_USERNAME }}
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
run: |
- ./mvnw -e -B --settings .github/mvn-settings.xml \
+ ./mvnw -e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml \
-DskipITs -DskipTests -Dskip.gradle.tests -Dno-format -Dinvoker.skip=true \
-DretryFailedDeploymentCount=10 \
-pl !integration-tests/gradle \
diff --git a/.github/workflows/jdk-early-access-build.yml b/.github/workflows/jdk-early-access-build.yml
index 893e49ddcade25..7e15e0cd4b9741 100644
--- a/.github/workflows/jdk-early-access-build.yml
+++ b/.github/workflows/jdk-early-access-build.yml
@@ -21,7 +21,7 @@ env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
MAVEN_OPTS: -Xmx2g -XX:MaxMetaspaceSize=1g
- JVM_TEST_MAVEN_OPTS: "-e -B --settings .github/mvn-settings.xml -Dtest-containers -Dstart-containers -Dtest-resteasy-reactive-large-files -Dformat.skip"
+ JVM_TEST_MAVEN_OPTS: "-e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -Dtest-containers -Dstart-containers -Dtest-resteasy-reactive-large-files -Dformat.skip"
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_NAME: hibernate_orm_test
diff --git a/.github/workflows/native-cron-build.yml.disabled b/.github/workflows/native-cron-build.yml.disabled
index 958f21e6aefb37..b8c9c9a7312ace 100644
--- a/.github/workflows/native-cron-build.yml.disabled
+++ b/.github/workflows/native-cron-build.yml.disabled
@@ -55,7 +55,7 @@ jobs:
run: ./mvnw -B install -DskipTests -DskipITs -Dformat.skip
- name: Run integration tests in native
- run: ./mvnw -B --settings .github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Dtest-containers -Dstart-containers -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.2-java${{ matrix.java }} -pl '!io.quarkus:quarkus-integration-test-google-cloud-functions-http,!io.quarkus:quarkus-integration-test-google-cloud-functions,!io.quarkus:quarkus-integration-test-funqy-google-cloud-functions'
+ run: ./mvnw -B --settings ${{ github.workspace }}/.github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Dtest-containers -Dstart-containers -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.2-java${{ matrix.java }} -pl '!io.quarkus:quarkus-integration-test-google-cloud-functions-http,!io.quarkus:quarkus-integration-test-google-cloud-functions,!io.quarkus:quarkus-integration-test-funqy-google-cloud-functions'
- name: Report
if: always()
diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml
index b865b2b2da716e..4f95fbcb02c1d9 100644
--- a/.github/workflows/release-build.yml
+++ b/.github/workflows/release-build.yml
@@ -28,7 +28,7 @@ jobs:
run: mkdir -p $HOME/release/repository
- name: Build and Test
run: |
- ./mvnw --settings .github/mvn-settings.xml \
+ ./mvnw --settings ${{ github.workspace }}/.github/mvn-settings.xml \
-B \
-Prelease \
-DskipTests -DskipITs \
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index 2cef27edafde75..02533d46e9f7b3 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -38,4 +38,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- run: ./mvnw -e -B --settings .github/mvn-settings.xml -Dquickly-ci install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=quarkusio -Dsonar.projectKey=quarkusio_quarkus -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectName=Quarkus -Dsonar.java.libraries=/home/runner/.m2/repository/**/*.jar
+ run: ./mvnw -e -B --settings ${{ github.workspace }}/.github/mvn-settings.xml -Dquickly-ci install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=quarkusio -Dsonar.projectKey=quarkusio_quarkus -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectName=Quarkus -Dsonar.java.libraries=/home/runner/.m2/repository/**/*.jar
diff --git a/build-parent/pom.xml b/build-parent/pom.xml
index 4b5c4a03d1cdb3..55bbf1411a15e9 100644
--- a/build-parent/pom.xml
+++ b/build-parent/pom.xml
@@ -442,7 +442,6 @@
org.jboss.logmanager.LogManager
${maven.home}
${settings.localRepository}
- ${session.request.userSettingsFile.path}
${project.version}
${project.groupId}
@@ -461,7 +460,6 @@
org.jboss.logmanager.LogManager
${maven.home}
${settings.localRepository}
- ${session.request.userSettingsFile.path}
${project.version}
${project.groupId}
@@ -1281,5 +1279,39 @@
+
+
+ user-session-settings
+
+
+ ${session.request.userSettingsFile.path}
+
+
+
+
+
+
+ maven-surefire-plugin
+ ${version.surefire.plugin}
+
+
+
+ ${session.request.userSettingsFile.path}
+
+
+
+
+ maven-failsafe-plugin
+ ${failsafe-plugin.version}
+
+
+ ${session.request.userSettingsFile.path}
+
+
+
+
+
+
+
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/Quarkus.java b/core/runtime/src/main/java/io/quarkus/runtime/Quarkus.java
index 123e2047fec22e..8d1115da41347d 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/Quarkus.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/Quarkus.java
@@ -65,7 +65,7 @@ public static void run(Class extends QuarkusApplication> quarkusApplication, B
//we already have an application, run it directly
Class extends Application> appClass = (Class extends Application>) Class.forName(Application.APP_CLASS_NAME,
false, Thread.currentThread().getContextClassLoader());
- Application application = appClass.newInstance();
+ Application application = appClass.getDeclaredConstructor().newInstance();
ApplicationLifecycleManager.run(application, quarkusApplication, exitHandler, args);
return;
} catch (ClassNotFoundException e) {
@@ -84,7 +84,6 @@ public static void run(Class extends QuarkusApplication> quarkusApplication, B
//this is not the quarkus:dev path as it will augment before
//calling this method
launchFromIDE(quarkusApplication, args);
-
}
private static void launchFromIDE(Class extends QuarkusApplication> quarkusApplication, String... args) {
diff --git a/devtools/cli/src/test/java/io/quarkus/cli/CliCreateExtensionTest.java b/devtools/cli/src/test/java/io/quarkus/cli/CliCreateExtensionTest.java
index 160a2edbafe923..d35795821dcef0 100644
--- a/devtools/cli/src/test/java/io/quarkus/cli/CliCreateExtensionTest.java
+++ b/devtools/cli/src/test/java/io/quarkus/cli/CliCreateExtensionTest.java
@@ -112,8 +112,8 @@ public void testCreateExtensionDefaults() throws Exception {
"io.quarkiverse.custom",
"quarkus-custom-deployment",
CreateExtension.DEFAULT_QUARKIVERSE_VERSION);
- CliDriver.valdiateGeneratedSourcePackage(project.resolve("deployment"), "io/quarkiverse/custom/deployment");
- CliDriver.valdiateGeneratedTestPackage(project.resolve("deployment"), "io/quarkiverse/custom/test");
+ CliDriver.validateGeneratedSourcePackage(project.resolve("deployment"), "io/quarkiverse/custom/deployment");
+ CliDriver.validateGeneratedTestPackage(project.resolve("deployment"), "io/quarkiverse/custom/test");
Path itPom = project.resolve("integration-tests/pom.xml");
validateBasicIdentifiers(itPom, // pom
@@ -124,8 +124,8 @@ public void testCreateExtensionDefaults() throws Exception {
"io.quarkiverse.custom",
"quarkus-custom-integration-tests",
CreateExtension.DEFAULT_QUARKIVERSE_VERSION);
- CliDriver.valdiateGeneratedSourcePackage(project.resolve("integration-tests"), "io/quarkiverse/custom/it");
- CliDriver.valdiateGeneratedTestPackage(project.resolve("integration-tests"), "io/quarkiverse/custom/it");
+ CliDriver.validateGeneratedSourcePackage(project.resolve("integration-tests"), "io/quarkiverse/custom/it");
+ CliDriver.validateGeneratedTestPackage(project.resolve("integration-tests"), "io/quarkiverse/custom/it");
}
@Test
@@ -156,16 +156,16 @@ public void testCreateExtension() throws Exception {
"org.my", "something-parent", "0.1");
validateBasicIdentifiers(deploymentPom,
"org.my", "something-deployment", "0.1");
- CliDriver.valdiateGeneratedSourcePackage(project.resolve("deployment"), "org/my/something/deployment");
- CliDriver.valdiateGeneratedTestPackage(project.resolve("deployment"), "org/my/something/test");
+ CliDriver.validateGeneratedSourcePackage(project.resolve("deployment"), "org/my/something/deployment");
+ CliDriver.validateGeneratedTestPackage(project.resolve("deployment"), "org/my/something/test");
Path itPom = project.resolve("integration-tests/pom.xml");
validateBasicIdentifiers(itPom, // pom
"org.my", "something-parent", "0.1");
validateBasicIdentifiers(itPom,
"org.my", "something-integration-tests", "0.1");
- CliDriver.valdiateGeneratedSourcePackage(project.resolve("integration-tests"), "org/my/something/it");
- CliDriver.valdiateGeneratedTestPackage(project.resolve("integration-tests"), "org/my/something/it");
+ CliDriver.validateGeneratedSourcePackage(project.resolve("integration-tests"), "org/my/something/it");
+ CliDriver.validateGeneratedTestPackage(project.resolve("integration-tests"), "org/my/something/it");
}
String validateBasicIdentifiers(Path pom, String group, String artifact, String version) throws Exception {
diff --git a/devtools/cli/src/test/java/io/quarkus/cli/CliDriver.java b/devtools/cli/src/test/java/io/quarkus/cli/CliDriver.java
index ddf060402c37ea..2c90ecac53b339 100644
--- a/devtools/cli/src/test/java/io/quarkus/cli/CliDriver.java
+++ b/devtools/cli/src/test/java/io/quarkus/cli/CliDriver.java
@@ -6,6 +6,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
@@ -37,9 +38,7 @@ public CliDriverBuilder setStartingDir(Path startingDir) {
}
public CliDriverBuilder addArgs(String... args) {
- for (String s : args) {
- this.args.add(s);
- }
+ this.args.addAll(Arrays.asList(args));
return this;
}
@@ -81,7 +80,7 @@ public Result execute() throws Exception {
PrintStream errPs = new PrintStream(err);
System.setErr(errPs);
- final Map originalProps = collectOverridenProps(newArgs);
+ final Map originalProps = collectOverriddenProps(newArgs);
Result result = new Result();
QuarkusCli cli = new QuarkusCli();
@@ -109,7 +108,7 @@ protected void resetProperties(Map originalProps) {
}
}
- protected Map collectOverridenProps(List newArgs) {
+ protected Map collectOverriddenProps(List newArgs) {
final Map originalProps = new HashMap<>();
for (String s : newArgs) {
if (s.startsWith("-D")) {
@@ -121,6 +120,8 @@ protected Map collectOverridenProps(List newArgs) {
originalProps.put(propName, origValue);
} else if (System.getProperties().contains(propName)) {
originalProps.put(propName, "true");
+ } else {
+ originalProps.put(propName, null);
}
}
}
@@ -233,7 +234,7 @@ public static String readFileAsString(Path projectRoot, Path path) throws Except
return new String(Files.readAllBytes(path));
}
- public static void valdiateGeneratedSourcePackage(Path projectRoot, String name) {
+ public static void validateGeneratedSourcePackage(Path projectRoot, String name) {
Path packagePath = projectRoot.resolve("src/main/java/" + name);
Assertions.assertTrue(packagePath.toFile().exists(),
"Package directory should exist: " + packagePath.toAbsolutePath().toString());
@@ -241,7 +242,7 @@ public static void valdiateGeneratedSourcePackage(Path projectRoot, String name)
"Package directory should be a directory: " + packagePath.toAbsolutePath().toString());
}
- public static void valdiateGeneratedTestPackage(Path projectRoot, String name) {
+ public static void validateGeneratedTestPackage(Path projectRoot, String name) {
Path packagePath = projectRoot.resolve("src/test/java/" + name);
Assertions.assertTrue(packagePath.toFile().exists(),
"Package directory should exist: " + packagePath.toAbsolutePath().toString());
diff --git a/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java b/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java
index f27bb1a3860bc1..1c71e228968d83 100644
--- a/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java
+++ b/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java
@@ -112,7 +112,7 @@ public void testCreateAppDefaults() throws Exception {
Assertions.assertTrue(buildGradleContent.contains("quarkus-resteasy"),
"build/gradle should contain quarkus-resteasy:\n" + buildGradleContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "org/acme");
+ CliDriver.validateGeneratedSourcePackage(project, "org/acme");
CliDriver.invokeValidateBuild(project);
}
@@ -137,7 +137,7 @@ public void testCreateAppDefaultsWithKotlinDSL() throws Exception {
Assertions.assertTrue(packagePath.toFile().isDirectory(),
"Java Source directory should exist: " + packagePath.toAbsolutePath());
- CliDriver.valdiateGeneratedSourcePackage(project, "org/acme");
+ CliDriver.validateGeneratedSourcePackage(project, "org/acme");
CliDriver.invokeValidateBuild(project);
}
@@ -169,7 +169,7 @@ public void testCreateAppOverrides() throws Exception {
Assertions.assertTrue(buildGradleContent.contains("quarkus-resteasy-reactive"),
"build.gradle should contain quarkus-resteasy-reactive:\n" + buildGradleContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "custom/pkg");
+ CliDriver.validateGeneratedSourcePackage(project, "custom/pkg");
CliDriver.validateApplicationProperties(project, configs);
result = CliDriver.invokeValidateDryRunBuild(project);
@@ -196,7 +196,7 @@ public void testCreateCliDefaults() throws Exception {
Assertions.assertTrue(buildGradleContent.contains("quarkus-picocli"),
"build/gradle should contain quarkus-picocli:\n" + buildGradleContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "org/acme");
+ CliDriver.validateGeneratedSourcePackage(project, "org/acme");
CliDriver.invokeValidateBuild(project);
}
diff --git a/devtools/cli/src/test/java/io/quarkus/cli/CliProjectMavenTest.java b/devtools/cli/src/test/java/io/quarkus/cli/CliProjectMavenTest.java
index db8562e3b22f8b..b72631bf9bde85 100644
--- a/devtools/cli/src/test/java/io/quarkus/cli/CliProjectMavenTest.java
+++ b/devtools/cli/src/test/java/io/quarkus/cli/CliProjectMavenTest.java
@@ -54,7 +54,7 @@ public void testCreateAppDefaults() throws Exception {
Assertions.assertTrue(pomContent.contains("quarkus-resteasy-reactive"),
"pom.xml should contain quarkus-resteasy-reactive:\n" + pomContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "org/acme");
+ CliDriver.validateGeneratedSourcePackage(project, "org/acme");
result = CliDriver.invokeValidateDryRunBuild(project);
@@ -91,7 +91,7 @@ public void testCreateAppOverrides() throws Exception {
Assertions.assertTrue(pomContent.contains("quarkus-resteasy-reactive"),
"pom.xml should contain quarkus-resteasy-reactive:\n" + pomContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "custom/pkg");
+ CliDriver.validateGeneratedSourcePackage(project, "custom/pkg");
CliDriver.validateApplicationProperties(project, configs);
result = CliDriver.invokeValidateDryRunBuild(project);
@@ -269,7 +269,7 @@ public void testCreateCliDefaults() throws Exception {
Assertions.assertTrue(pomContent.contains("quarkus-picocli"),
"pom.xml should contain quarkus-picocli:\n" + pomContent);
- CliDriver.valdiateGeneratedSourcePackage(project, "org/acme");
+ CliDriver.validateGeneratedSourcePackage(project, "org/acme");
result = CliDriver.invokeValidateDryRunBuild(project);
diff --git a/devtools/cli/src/test/java/io/quarkus/cli/RegistryClientBuilderTestBase.java b/devtools/cli/src/test/java/io/quarkus/cli/RegistryClientBuilderTestBase.java
index 00a402bcda5cad..7bb4957d804a66 100644
--- a/devtools/cli/src/test/java/io/quarkus/cli/RegistryClientBuilderTestBase.java
+++ b/devtools/cli/src/test/java/io/quarkus/cli/RegistryClientBuilderTestBase.java
@@ -7,6 +7,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
+import java.util.Objects;
import org.apache.maven.settings.Profile;
import org.apache.maven.settings.Repository;
@@ -59,7 +60,8 @@ static void setup() throws Exception {
final BootstrapMavenContext mavenContext = new BootstrapMavenContext(
BootstrapMavenContext.config().setWorkspaceDiscovery(false));
- final Settings settings = getBaseMavenSettings(mavenContext.getUserSettings().toPath());
+ var userSettings = mavenContext.getUserSettings();
+ final Settings settings = Objects.nonNull(userSettings) ? getBaseMavenSettings(userSettings.toPath()) : new Settings();
Profile profile = new Profile();
settings.addActiveProfile("qs-test-registry");