From 1dbe456218822c77ce908c7c0347816b6dfc93f0 Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Fri, 8 Mar 2024 09:12:05 -0600 Subject: [PATCH] Move package config to an interface * Change `PackageConfig` to an interface * Move JAR-specific configuration to `JarConfig` group * Replace package type with combination of JAR type and JAR/native enable flags * Introduce compatibility interceptors for complex remappings * Update all build steps, tests, and POMs to use the new properties --- bom/application/pom.xml | 2 +- build-parent/pom.xml | 2 +- .../deployment/cmd/RunCommandProcessor.java | 15 +- .../BuildTimeConfigurationReader.java | 1 + .../configuration/ConfigCompatibility.java | 521 ++++++++++++++++ .../dev/IsolatedRemoteDevModeMain.java | 3 +- .../deployment/jbang/JBangAugmentorImpl.java | 4 +- .../deployment/mutability/ReaugmentTask.java | 4 +- .../deployment/pkg/ManifestConfig.java | 34 -- .../quarkus/deployment/pkg/NativeConfig.java | 12 + .../quarkus/deployment/pkg/PackageConfig.java | 563 +++++++++--------- .../pkg/builditem/JarBuildItem.java | 13 +- .../builditem/LegacyJarRequiredBuildItem.java | 1 + .../pkg/builditem/OutputTargetBuildItem.java | 6 +- .../pkg/builditem/PackageTypeBuildItem.java | 4 +- .../builditem/UberJarRequiredBuildItem.java | 1 + .../deployment/pkg/steps/AppCDSBuildStep.java | 18 +- .../pkg/steps/JarResultBuildStep.java | 113 ++-- .../deployment/pkg/steps/NativeBuild.java | 13 +- .../pkg/steps/NativeImageBuildStep.java | 6 +- .../pkg/steps/NativeOrNativeSourcesBuild.java | 14 +- .../pkg/steps/NativeSourcesBuild.java | 13 +- .../PackageTypeVerificationBuildStep.java | 37 -- .../steps/ClassTransformingBuildStep.java | 2 +- .../deployment/steps/MainClassBuildStep.java | 6 +- .../runner/bootstrap/AugmentActionImpl.java | 3 + .../deployment/pkg/BuiltInTypeTest.java | 10 +- .../deployment/pkg/TestNativeConfig.java | 8 + devtools/cli/pom.xml | 4 +- .../io/quarkus/cli/build/GradleRunner.java | 3 +- .../src/main/resources/application.properties | 2 +- .../io/quarkus/cli/CliProjectGradleTest.java | 4 +- .../quarkus/cli/image/CliImageGradleTest.java | 6 +- ...o.quarkus.devtools.java-library.gradle.kts | 2 +- .../java/io/quarkus/gradle/QuarkusPlugin.java | 9 +- .../tasks/AbstractQuarkusExtension.java | 19 +- .../io/quarkus/gradle/tasks/BaseConfig.java | 21 +- .../quarkus/gradle/tasks/EffectiveConfig.java | 10 + .../io/quarkus/gradle/tasks/QuarkusBuild.java | 209 ++++--- .../tasks/QuarkusBuildCacheableAppParts.java | 94 +-- .../tasks/QuarkusBuildDependencies.java | 74 +-- .../gradle/tasks/QuarkusBuildTask.java | 123 ++-- .../tasks/QuarkusShowEffectiveConfig.java | 9 +- .../gradle/tasks/worker/BuildWorker.java | 3 +- .../io/quarkus/gradle/QuarkusPluginTest.java | 2 +- .../io/quarkus/gradle/tasks/CachingTest.java | 16 +- .../main/java/io/quarkus/maven/BuildMojo.java | 7 +- .../quarkus/maven/QuarkusBootstrapMojo.java | 21 +- .../maven/QuarkusBootstrapProvider.java | 6 +- .../quarkus/maven/TrackConfigChangesMojo.java | 5 +- .../build-native-container-parameters.adoc | 2 +- .../devtools/build-native-container.adoc | 4 +- .../_includes/devtools/build-native.adoc | 4 +- docs/src/main/asciidoc/appcds.adoc | 6 +- .../main/asciidoc/building-native-image.adoc | 12 +- .../asciidoc/deploying-to-google-cloud.adoc | 2 +- docs/src/main/asciidoc/gradle-tooling.adoc | 12 +- docs/src/main/asciidoc/jreleaser.adoc | 2 +- docs/src/main/asciidoc/maven-tooling.adoc | 16 +- docs/src/main/asciidoc/native-and-ssl.adoc | 2 +- docs/src/main/asciidoc/reaugmentation.adoc | 4 +- .../resources/archetype-resources/pom.xml | 2 +- .../resources/archetype-resources/pom.xml | 2 +- .../resources/archetype-resources/pom.xml | 2 +- .../deployment/AzureFunctionsProcessor.java | 4 +- .../deployment/BuildpackProcessor.java | 2 - .../docker/deployment/DockerProcessor.java | 4 +- .../deployment/ContainerImageJibConfig.java | 2 +- .../image/jib/deployment/JibProcessor.java | 12 +- .../deployment/OpenshiftProcessor.java | 7 +- .../resources/archetype-resources/pom.xml | 2 +- .../CloudFunctionsDeploymentBuildStep.java | 2 +- .../CloudFunctionsDeploymentBuildStep.java | 2 +- .../CloudFunctionDeploymentBuildStep.java | 2 +- .../deployment/KubernetesCommonHelper.java | 3 +- .../deployment/KubernetesProcessor.java | 10 +- .../qute/deployment/QuteProcessor.java | 6 +- .../deployment/RestClientProcessor.java | 10 +- .../io/quarkus/maven/dependency/GACT.java | 9 + .../io/quarkus/bootstrap/app/JarResult.java | 10 +- .../bootstrap/jbang/JBangBuilderImpl.java | 2 +- .../modules-in-profiles/runner/pom.xml | 2 +- .../bootstrap/runner/QuarkusEntryPoint.java | 2 +- .../java/integration-tests/pom.tpl.qute.xml | 2 +- .../buildtool/gradle-kotlin-dsl/codestart.yml | 8 +- .../quarkus/buildtool/gradle/codestart.yml | 8 +- .../buildtool/maven/base/pom.tpl.qute.xml | 4 +- .../quarkus/buildtool/maven/codestart.yml | 4 +- .../QuarkusCodestartGenerationTest.java | 8 +- .../generateDefault/README.md | 2 +- .../generateDefault/pom.xml | 2 +- .../generateMavenWithCustomDep/pom.xml | 2 +- .../amazon-lambda-rest-funqy/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../amazon-lambda-rest-servlet/pom.xml | 2 +- integration-tests/bouncycastle-fips/pom.xml | 2 +- integration-tests/bouncycastle/pom.xml | 2 +- .../src/it/container-build-docker/pom.xml | 2 +- .../src/it/container-build-jib-appcds/pom.xml | 2 +- .../src/main/resources/application.properties | 4 +- .../it/container-build-jib-inherit/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../src/it/container-build-jib/pom.xml | 2 +- .../pom.xml | 2 +- .../container-build-multiple-tags-jib/pom.xml | 2 +- .../src/it/container-image-push/pom.xml | 2 +- integration-tests/elytron-security/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/test/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../gradle/BuildConfigurationTest.java | 2 +- .../gradle/ConditionalDependenciesTest.java | 4 +- .../gradle/DependencyConstraintsTest.java | 3 +- .../gradle/QuarkusPluginFunctionalTest.java | 2 +- ...ystemPropsAsBuildTimeConfigSourceTest.java | 2 +- .../nativeimage/BasicJavaNativeBuildIT.java | 2 +- .../nativeimage/NativeIntegrationTestIT.java | 2 +- .../database-generator/pom.xml | 2 +- .../java/DefaultPackageWithFastJarPMT.java | 2 +- .../kotlin/DefaultPackageWithFastJarPMT.kt | 2 +- .../java/DefaultPackageWithFastJarPMT.java | 2 +- .../src/it/xds-grpc/invoker.properties | 2 +- .../maven-invoker-way/src/it/xds-grpc/pom.xml | 2 +- .../resources/projects/classic-kotlin/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../projects/kotlin-compiler-args/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../kubernetes-service-binding-jdbc/pom.xml | 2 +- .../pom.xml | 2 +- .../it/knative-jib-build-and-deploy/pom.xml | 2 +- .../invoker.properties | 2 +- .../pom.xml | 2 +- .../invoker.properties | 2 +- .../pom.xml | 2 +- .../invoker.properties | 2 +- .../kubernetes-jib-build-and-deploy/pom.xml | 2 +- .../invoker.properties | 2 +- .../pom.xml | 2 +- .../kubernetes-with-grpc-same-server/pom.xml | 2 +- .../src/it/kubernetes-with-grpc/pom.xml | 2 +- .../invoker.properties | 2 +- .../minikube-with-existing-manifest/pom.xml | 2 +- .../invoker.properties | 2 +- .../pom.xml | 2 +- .../invoker.properties | 2 +- .../openshift-docker-build-and-deploy/pom.xml | 2 +- .../invoker.properties | 2 +- .../it/openshift-s2i-build-and-deploy/pom.xml | 2 +- .../pom.xml | 2 +- .../openshift-with-uberjar.properties | 2 +- integration-tests/main/pom.xml | 2 +- .../java/io/quarkus/maven/it/JarRunnerIT.java | 14 +- .../java/io/quarkus/maven/it/PackageIT.java | 15 +- .../integration-tests/itest/pom.xml | 2 +- .../apt-in-annotation-processor-paths/pom.xml | 2 +- .../apt-in-annotation-processors/pom.xml | 2 +- .../projects/apt-in-classpath/pom.xml | 2 +- .../arc-exclude-dependencies/runner/pom.xml | 2 +- .../projects/basic-command-mode/pom.xml | 2 +- .../capabilities-conflict/runner/pom.xml | 2 +- .../capabilities-missing/runner/pom.xml | 2 +- .../projects/classic-2.x/pom.xml | 2 +- .../projects/classic-inst/pom.xml | 2 +- .../projects/classic-no-build/pom.xml | 2 +- .../projects/classic-no-generate/pom.xml | 2 +- .../projects/classic-no-undertow/pom.xml | 2 +- .../projects/classic-noconfig/pom.xml | 2 +- .../projects/classic-remote-dev/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../classic-resource-filtering/pom.xml | 2 +- .../projects/classic/pom.xml | 2 +- .../classloader-linkage-error/pom.xml | 4 +- .../app/src/main/docker/Dockerfile.legacy-jar | 2 +- .../pom.xml | 4 +- .../conditional-dependencies/runner/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../projects/dependency-on-pom/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../integration-tests/pom.xml | 2 +- .../projects/ignore-entries-uber-jar/pom.xml | 2 +- .../modules-in-profiles/runner/pom.xml | 2 +- .../projects/multi-build-mode/pom.xml | 34 +- .../projects/multijar-module/runner/pom.xml | 2 +- .../multimodule-classpath/runner/pom.xml | 2 +- .../multimodule-revision-prop/runner/pom.xml | 2 +- .../multimodule-root-no-src/runner/pom.xml | 2 +- .../projects/multimodule/runner/pom.xml | 2 +- .../projects/native-image-app/pom.xml | 2 +- .../projects/no-resource-root/pom.xml | 2 +- .../platform-properties-overrides/app/pom.xml | 2 +- .../project-with-extension/runner/pom.xml | 2 +- .../projects/property-expansion/pom.xml | 2 +- .../property-overrides/runner/pom.xml | 2 +- .../projects/proto-gen/pom.xml | 2 +- .../runner/pom.xml | 2 +- .../quarkus-index-dependencies/runner/pom.xml | 2 +- .../quarkus.package.output-directory/pom.xml | 2 +- .../projects/reactive-routes/pom.xml | 6 +- .../runner/pom.xml | 2 +- .../projects/rr-with-json-logging/pom.xml | 2 +- .../test-module-dependency/app/pom.xml | 2 +- .../projects/uberjar-check/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../uberjar-maven-plugin-config/pom.xml | 4 +- ...-quarkiverse-ext_integration-tests_pom.xml | 2 +- .../mongodb-rest-data-panache/pom.xml | 2 +- integration-tests/mtls-certificates/pom.xml | 2 +- integration-tests/openapi/pom.xml | 2 +- integration-tests/opentelemetry-grpc/pom.xml | 2 +- .../pom.xml | 2 +- .../opentelemetry-quickstart/pom.xml | 2 +- .../opentelemetry-reactive-messaging/pom.xml | 2 +- .../opentelemetry-reactive/pom.xml | 2 +- integration-tests/opentelemetry-spi/pom.xml | 2 +- integration-tests/opentelemetry-vertx/pom.xml | 2 +- integration-tests/opentelemetry/pom.xml | 2 +- .../AbstractRemovedResourceTest.java | 2 +- .../custom-entries-thin.properties | 4 +- .../custom-entries-uber.properties | 4 +- .../custom-manifest-thin.properties | 6 +- .../custom-manifest-uber.properties | 6 +- .../no-custom-manifest-thin.properties | 2 +- .../no-custom-manifest-uber.properties | 2 +- integration-tests/pom.xml | 2 +- .../rest-client-reactive-http2/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../rest-client-reactive-multipart/pom.xml | 2 +- .../rest-client-reactive-stork/pom.xml | 2 +- .../rest-client-reactive/pom.xml | 2 +- .../resources/projects/classic-scala/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- integration-tests/smallrye-metrics/pom.xml | 2 +- .../smallrye-stork-registration/pom.xml | 2 +- .../src/main/resources/application.properties | 2 +- .../deployment/UberJarConfigBuildStep.java | 4 +- .../GeneratedResourceBuildItemTest.java | 2 +- .../UberJarIgnoredResourceBuildItemTest.java | 2 +- .../UberJarMergedResourceBuildItemTest.java | 2 +- .../test-extension/tests/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- integration-tests/virtual-threads/pom.xml | 2 +- .../io/quarkus/test/QuarkusProdModeTest.java | 2 +- 252 files changed, 1642 insertions(+), 1047 deletions(-) create mode 100644 core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigCompatibility.java delete mode 100644 core/deployment/src/main/java/io/quarkus/deployment/pkg/ManifestConfig.java delete mode 100644 core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/PackageTypeVerificationBuildStep.java diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 416081863695bf..30d89947aed486 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -51,7 +51,7 @@ 2.0 3.1.1 2.3.0 - 3.6.1 + 3.6.2-SNAPSHOT 4.1.0 4.0.0 3.10.0 diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 234c553a3be9da..f15e29c696ae5e 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -447,7 +447,7 @@ - ${jacoco.agent.argLine} -Xmx1500m -XX:MaxMetaspaceSize=1500m -Djava.io.tmpdir="${project.build.directory}" ${surefire.argLine.additional} + ${jacoco.agent.argLine} -Xmx2048m -XX:MaxMetaspaceSize=2048m -Djava.io.tmpdir="${project.build.directory}" ${surefire.argLine.additional} MAVEN_OPTS diff --git a/core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandProcessor.java index 11a968c9d36e89..3617575bf8281a 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandProcessor.java @@ -1,5 +1,6 @@ package io.quarkus.deployment.cmd; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.deployment.pkg.steps.JarResultBuildStep.DEFAULT_FAST_JAR_DIRECTORY_NAME; import static io.quarkus.deployment.pkg.steps.JarResultBuildStep.QUARKUS_RUN_JAR; @@ -25,6 +26,7 @@ public RunCommandActionResultBuildItem commands(List return new RunCommandActionResultBuildItem(cmds); } + @SuppressWarnings("deprecation") // legacy jar @BuildStep public void defaultJavaCommand(PackageConfig packageConfig, OutputTargetBuildItem jar, @@ -34,13 +36,14 @@ public void defaultJavaCommand(PackageConfig packageConfig, Path jarPath = null; if (legacyJarRequired.isEmpty() && (!uberJarRequired.isEmpty() - || packageConfig.type.equalsIgnoreCase(PackageConfig.UBER_JAR))) { + || packageConfig.jar().type() == UBER_JAR)) { jarPath = jar.getOutputDirectory() - .resolve(jar.getBaseName() + packageConfig.getRunnerSuffix() + ".jar"); - } else if (!legacyJarRequired.isEmpty() || packageConfig.isLegacyJar() - || packageConfig.type.equalsIgnoreCase(PackageConfig.LEGACY)) { + .resolve(jar.getBaseName() + packageConfig.computedRunnerSuffix() + ".jar"); + } else if (!legacyJarRequired.isEmpty() + || packageConfig.jar().type() == LEGACY_JAR) { + // todo: legacy JAR should be using runnerSuffix() jarPath = jar.getOutputDirectory() - .resolve(jar.getBaseName() + packageConfig.getRunnerSuffix() + ".jar"); + .resolve(jar.getBaseName() + packageConfig.computedRunnerSuffix() + ".jar"); } else { jarPath = jar.getOutputDirectory().resolve(DEFAULT_FAST_JAR_DIRECTORY_NAME).resolve(QUARKUS_RUN_JAR); @@ -49,7 +52,7 @@ public void defaultJavaCommand(PackageConfig packageConfig, List args = new ArrayList<>(); args.add(determineJavaPath()); - for (Map.Entry e : System.getProperties().entrySet()) { + for (Map.Entry e : System.getProperties().entrySet()) { args.add("-D" + e.getKey().toString() + "=" + e.getValue().toString()); } args.add("-jar"); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java index 0f9496d1d1bde8..bc6fa05e00cc7e 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java @@ -409,6 +409,7 @@ public SmallRyeConfig initConfiguration(LaunchMode launchMode, Properties buildS } builder.withInterceptors(buildConfigTracker); + builder.withInterceptors(ConfigCompatibility.FrontEnd.instance(), ConfigCompatibility.BackEnd.instance()); var config = builder.build(); buildConfigTracker.configure(config); return config; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigCompatibility.java b/core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigCompatibility.java new file mode 100644 index 00000000000000..3c26d38b4b32c2 --- /dev/null +++ b/core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigCompatibility.java @@ -0,0 +1,521 @@ +package io.quarkus.deployment.configuration; + +import static java.util.Collections.emptyIterator; +import static java.util.Map.entry; + +import java.io.Serial; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.function.BiFunction; + +import jakarta.annotation.Priority; + +import org.jboss.logging.Logger; + +import io.smallrye.config.ConfigSourceInterceptor; +import io.smallrye.config.ConfigSourceInterceptorContext; +import io.smallrye.config.ConfigValue; +import io.smallrye.config.KeyMap; +import io.smallrye.config.NameIterator; + +/** + * A class which manages configuration compatibility for the build-time configuration. + * The mechanism is to keep a matching table of old names and new names. + * Old names are detected at the front end iterator and mapped to the corresponding new name(s) that replace them. + * New names are detected at the back end getter, which queries the corresponding old name(s) to determine the new value. + *

+ * This is intended to be a temporary and evolutionary solution to be replaced by generative remapping. + * It is more flexible than fallback remapping, allowing 1:N and N:1 remappings and support for submaps. + * Unfortunately it is also very verbose. + */ +public final class ConfigCompatibility { + + private static final Logger log = Logger.getLogger("io.quarkus.deployment.configuration"); + + /** + * When these legacy name patterns are detected on iteration, remove them or replace them with other name(s). + */ + private static final KeyMap>> oldNames = keyMap( + entry(List.of("quarkus", "package", "type"), ConfigCompatibility::quarkusPackageType), + entry(List.of("quarkus", "package", "create-appcds"), ConfigCompatibility::quarkusPackageCreateAppcds), + entry(List.of("quarkus", "package", "appcds-builder-image"), ConfigCompatibility::quarkusPackageAppcdsBuilderImage), + entry(List.of("quarkus", "package", "appcds-use-container"), ConfigCompatibility::quarkusPackageAppcdsUseContainer), + entry(List.of("quarkus", "package", "compress-jar"), ConfigCompatibility::quarkusPackageCompressJar), + entry(List.of("quarkus", "package", "add-runner-suffix"), ConfigCompatibility::quarkusPackageAddRunnerSuffix), + entry(List.of("quarkus", "package", "user-configured-ignored-entries"), + ConfigCompatibility::quarkusPackageUserConfiguredIgnoredEntries), + entry(List.of("quarkus", "package", "user-providers-directory"), + ConfigCompatibility::quarkusPackageUserProvidersDirectory), + entry(List.of("quarkus", "package", "included-optional-dependencies"), + ConfigCompatibility::quarkusPackageIncludedOptionalDependencies), + entry(List.of("quarkus", "package", "include-dependency-list"), + ConfigCompatibility::quarkusPackageIncludeDependencyList), + entry(List.of("quarkus", "package", "vineflower", "version"), + ConfigCompatibility::quarkusPackageVineflowerVersion), + entry(List.of("quarkus", "package", "vineflower", "enabled"), + ConfigCompatibility::quarkusPackageVineflowerEnabled), + entry(List.of("quarkus", "package", "vineflower", "jar-directory"), + ConfigCompatibility::quarkusPackageVineflowerJarDirectory), + entry(List.of("quarkus", "package", "manifest", "attributes", "*"), + ConfigCompatibility::quarkusPackageManifestAttributes), + entry(List.of("quarkus", "package", "manifest", "sections", "*", "*"), + ConfigCompatibility::quarkusPackageManifestSections), + entry(List.of("quarkus", "package", "manifest", "add-implementation-entries"), + ConfigCompatibility::quarkusPackageManifestAddImplementationEntries)); + + /** + * When these new name patterns are detected on get, see if legacy values are present and if so, + * provide a default based on those value(s). + */ + public static final KeyMap> newNames = keyMap( + entry(List.of("quarkus", "native", "enabled"), ConfigCompatibility::quarkusNativeEnabled), + entry(List.of("quarkus", "native", "sources-only"), ConfigCompatibility::quarkusNativeSourcesOnly), + entry(List.of("quarkus", "package", "jar", "enabled"), ConfigCompatibility::quarkusPackageJarEnabled), + entry(List.of("quarkus", "package", "jar", "appcds", "enabled"), + ConfigCompatibility::quarkusPackageJarAppcdsEnabled), + entry(List.of("quarkus", "package", "jar", "appcds", "builder-image"), + ConfigCompatibility::quarkusPackageJarAppcdsBuilderImage), + entry(List.of("quarkus", "package", "jar", "appcds", "use-container"), + ConfigCompatibility::quarkusPackageJarAppcdsUseContainer), + entry(List.of("quarkus", "package", "jar", "type"), ConfigCompatibility::quarkusPackageJarType), + entry(List.of("quarkus", "package", "jar", "compress"), ConfigCompatibility::quarkusPackageJarCompress), + entry(List.of("quarkus", "package", "jar", "add-runner-suffix"), + ConfigCompatibility::quarkusPackageJarAddRunnerSuffix), + entry(List.of("quarkus", "package", "jar", "user-configured-ignored-entries"), + ConfigCompatibility::quarkusPackageJarUserConfiguredIgnoredEntries), + entry(List.of("quarkus", "package", "jar", "user-providers-directory"), + ConfigCompatibility::quarkusPackageJarUserProvidersDirectory), + entry(List.of("quarkus", "package", "jar", "included-optional-dependencies"), + ConfigCompatibility::quarkusPackageJarIncludedOptionalDependencies), + entry(List.of("quarkus", "package", "jar", "include-dependency-list"), + ConfigCompatibility::quarkusPackageJarIncludeDependencyList), + entry(List.of("quarkus", "package", "jar", "manifest", "attributes", "*"), + ConfigCompatibility::quarkusPackageJarManifestAttributes), + entry(List.of("quarkus", "package", "jar", "manifest", "sections", "*", "*"), + ConfigCompatibility::quarkusPackageJarManifestSections), + entry(List.of("quarkus", "package", "jar", "manifest", "add-implementation-entries"), + ConfigCompatibility::quarkusPackageJarManifestAddImplementationEntries), + entry(List.of("quarkus", "package", "decompiler", "enabled"), ConfigCompatibility::quarkusPackageDecompilerEnabled), + entry(List.of("quarkus", "package", "decompiler", "jar-directory"), + ConfigCompatibility::quarkusPackageDecompilerJarDirectory)); + + /** + * The interceptor at the front of the chain which handles hiding deprecated properties from the iterator. + */ + @Priority(Integer.MAX_VALUE) + public static final class FrontEnd implements ConfigSourceInterceptor { + @Serial + private static final long serialVersionUID = -3438497970389074611L; + + private static final FrontEnd instance = new FrontEnd(); + + private FrontEnd() { + } + + public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { + return context.proceed(name); + } + + public Iterator iterateNames(final ConfigSourceInterceptorContext context) { + Iterator nextIter = context.iterateNames(); + return new Iterator() { + /** + * Replacement names iterator. + */ + Iterator subIter = emptyIterator(); + /** + * The next value. + */ + String next; + + public boolean hasNext() { + while (next == null) { + if (subIter.hasNext()) { + // more replacement names remain + next = subIter.next(); + return true; + } + if (!nextIter.hasNext()) { + return false; + } + String next = nextIter.next(); + var fn = oldNames.findRootValue(next); + if (fn == null) { + // it's not a deprecated name, so we can return it as-is + this.next = next; + return true; + } + // get the replacement names + List list = fn.apply(context, new NameIterator(next)); + subIter = list.iterator(); + // todo: print these warnings when mapping the configuration so they cannot appear more than once + if (list.isEmpty()) { + log.warnf("Configuration property '%s' has been deprecated and will be ignored", next); + } else { + log.warnf("Configuration property '%s' has been deprecated and replaced by: %s", next, list); + } + } + return true; + } + + public String next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + String next = this.next; + this.next = null; + return next; + } + }; + } + + public static FrontEnd instance() { + return instance; + } + } + + /** + * The interceptor at the back of the chain which provides compatibility defaults for new property names. + */ + @Priority(Integer.MIN_VALUE + 1) + public static final class BackEnd implements ConfigSourceInterceptor { + @Serial + private static final long serialVersionUID = 6840768821115677665L; + + private static final BackEnd instance = new BackEnd(); + + private BackEnd() { + } + + public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { + NameIterator ni = new NameIterator(name); + BiFunction function = newNames.findRootValue(ni); + return function != null ? function.apply(context, ni) : context.proceed(name); + } + + public static BackEnd instance() { + return instance; + } + } + + // front end mappings here + + private static List quarkusPackageType(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // check the value to see what properties we need to define + ConfigValue legacyPackageType = ctxt.proceed(ni.getName()); + if (legacyPackageType == null) { + // nothing to do + return List.of(); + } + // override defaults of all of these properties + return List.of("quarkus.package.jar.enabled", "quarkus.package.jar.type", "quarkus.native.enabled", + "quarkus.native.sources-only"); + } + + private static List quarkusPackageCreateAppcds(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.appcds.enabled"); + } + + private static List quarkusPackageAppcdsBuilderImage(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.appcds.builder-image"); + } + + private static List quarkusPackageAppcdsUseContainer(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.appcds.use-container"); + } + + private static List quarkusPackageCompressJar(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.compress"); + } + + private static List quarkusPackageAddRunnerSuffix(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.add-runner-suffix"); + } + + private static List quarkusPackageUserConfiguredIgnoredEntries(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + return List.of("quarkus.package.jar.user-configured-ignored-entries"); + } + + private static List quarkusPackageIncludeDependencyList(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.include-dependency-list"); + } + + private static List quarkusPackageUserProvidersDirectory(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + return List.of("quarkus.package.jar.user-providers-directory"); + } + + private static List quarkusPackageIncludedOptionalDependencies(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + return List.of("quarkus.package.jar.included-optional-dependencies"); + } + + private static List quarkusPackageVineflowerVersion(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // always hide this ignored property + return List.of(); + } + + private static List quarkusPackageVineflowerEnabled(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // simple mapping to a new name + return List.of("quarkus.package.decompiler.enabled"); + } + + private static List quarkusPackageVineflowerJarDirectory(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // simple mapping to a new name + return List.of("quarkus.package.decompiler.jar-directory"); + } + + private static List quarkusPackageManifestAttributes(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // mapping to a new name, copying the last segment + ni.goToEnd(); + ni.previous(); + return List.of("quarkus.package.jar.manifest.attributes." + ni.getName().substring(ni.getPosition() + 1)); + } + + private static List quarkusPackageManifestSections(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // mapping to a new name, copying the last two segments + ni.goToEnd(); + ni.previous(); + ni.previous(); + return List.of("quarkus.package.jar.manifest.sections." + ni.getName().substring(ni.getPosition() + 1)); + } + + private static List quarkusPackageManifestAddImplementationEntries(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + // simple mapping to a new name + return List.of("quarkus.package.jar.manifest.add-implementation-entries"); + } + + // back end mappings here + + private static final Set ANY_NATIVE = Set.of("native", "native-sources"); + + private static ConfigValue quarkusNativeEnabled(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // GraalVM native image is enabled if the legacy package type is "native" or "native sources" + ConfigValue ptVal = ctxt.restart("quarkus.package.type"); + if (ptVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + // map old name to new name + return ptVal.withName(ni.getName()).withValue( + Boolean.toString(ANY_NATIVE.contains(ptVal.getValue()))); + } + } + + private static ConfigValue quarkusPackageJarEnabled(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // the JAR packaging type is present if a JAR type was configured in the legacy property + ConfigValue ptVal = ctxt.restart("quarkus.package.type"); + if (ptVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return ptVal.withName(ni.getName()).withValue( + Boolean.toString(!ANY_NATIVE.contains(ptVal.getValue()))); + } + } + + private static ConfigValue quarkusPackageJarAppcdsEnabled(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.create-appcds"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarAppcdsBuilderImage(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.appcds-builder-image"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarAppcdsUseContainer(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.appcds-use-container"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarType(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue ptVal = ctxt.restart("quarkus.package.type"); + if (ptVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return ANY_NATIVE.contains(ptVal.getValue()) ? ctxt.proceed(ni.getName()) : ptVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarCompress(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.compress-jar"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarAddRunnerSuffix(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.add-runner-suffix"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarUserConfiguredIgnoredEntries(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.user-configured-ignored-entries"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarUserProvidersDirectory(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.user-providers-directory"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarIncludedOptionalDependencies(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.included-optional-dependencies"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarIncludeDependencyList(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.include-dependency-list"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusNativeSourcesOnly(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // GraalVM native image is enabled if the legacy package type is "native" or "native sources" + ConfigValue ptVal = ctxt.restart("quarkus.package.type"); + if (ptVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + // map old name to new name + return ptVal.withName(ni.getName()).withValue(Boolean.toString(ptVal.getValue().equals("native-sources"))); + } + } + + private static ConfigValue quarkusPackageJarManifestAttributes(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // mapping from a legacy name, copying the last segment + ni.goToEnd(); + ni.previous(); + String oldName = "quarkus.package.manifest.attributes." + ni.getName().substring(ni.getPosition() + 1); + ConfigValue oldVal = ctxt.restart(oldName); + if (oldVal == null) { + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarManifestSections(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + // mapping from a legacy name, copying the last two segments + ni.goToEnd(); + ni.previous(); + ni.previous(); + String oldName = "quarkus.package.manifest.sections." + ni.getName().substring(ni.getPosition() + 1); + ConfigValue oldVal = ctxt.restart(oldName); + if (oldVal == null) { + return ctxt.proceed(ni.getName()); + } else { + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageJarManifestAddImplementationEntries(ConfigSourceInterceptorContext ctxt, + NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.manifest.add-implementation-entries"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + // map old name to new name + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageDecompilerEnabled(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.vineflower.enabled"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + // map old name to new name + return oldVal.withName(ni.getName()); + } + } + + private static ConfigValue quarkusPackageDecompilerJarDirectory(ConfigSourceInterceptorContext ctxt, NameIterator ni) { + ConfigValue oldVal = ctxt.restart("quarkus.package.vineflower.jar-directory"); + if (oldVal == null) { + // on to the default value + return ctxt.proceed(ni.getName()); + } else { + // map old name to new name + return oldVal.withName(ni.getName()); + } + } + + // utilities + + @SafeVarargs + private static KeyMap keyMap( + Map.Entry, T>... entries) { + KeyMap keyMap = new KeyMap<>(); + KeyMap subMap; + for (Map.Entry, T> entry : entries) { + subMap = keyMap; + for (String part : entry.getKey()) { + if (part.equals("*")) { + subMap = subMap.getOrCreateAny(); + } else { + KeyMap tryMap = subMap.get(part); + if (tryMap == null) { + tryMap = new KeyMap<>(); + subMap.put(part, tryMap); + } + subMap = tryMap; + } + } + subMap.putRootValue(entry.getValue()); + } + return keyMap; + } +} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java index b01dce10be579d..6f54adaa0dd110 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java @@ -37,7 +37,6 @@ import io.quarkus.deployment.dev.remote.RemoteDevClient; import io.quarkus.deployment.dev.remote.RemoteDevClientProvider; import io.quarkus.deployment.mutability.DevModeTask; -import io.quarkus.deployment.pkg.PackageConfig; import io.quarkus.deployment.pkg.steps.JarResultBuildStep; import io.quarkus.deployment.steps.ClassTransformingBuildStep; import io.quarkus.dev.spi.DeploymentFailedStartHandler; @@ -90,7 +89,7 @@ private synchronized JarResult generateApplication() { //ok, we have resolved all the deps try { AugmentResult start = augmentAction.createProductionApplication(); - if (!start.getJar().getType().equalsIgnoreCase(PackageConfig.BuiltInType.MUTABLE_JAR.getValue())) { + if (!start.getJar().mutable()) { throw new RuntimeException( "remote-dev can only be used with mutable applications i.e. " + "using the mutable-jar package type"); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/jbang/JBangAugmentorImpl.java b/core/deployment/src/main/java/io/quarkus/deployment/jbang/JBangAugmentorImpl.java index ed9c482e829c13..f0289037eea196 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/jbang/JBangAugmentorImpl.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/jbang/JBangAugmentorImpl.java @@ -90,7 +90,9 @@ public void accept(BuildChainBuilder builder) { builder.addFinal(GeneratedResourceBuildItem.class); builder.addFinal(TransformedClassesBuildItem.class); builder.addFinal(DeploymentResultBuildItem.class); - boolean nativeRequested = "native".equals(System.getProperty("quarkus.package.type")); + // note: quarkus.package.type is deprecated + boolean nativeRequested = "native".equals(System.getProperty("quarkus.package.type")) + || "true".equals(System.getProperty("quarkus.native.enabled")); boolean containerBuildRequested = Boolean.getBoolean("quarkus.container-image.build"); if (nativeRequested) { builder.addFinal(NativeImageBuildItem.class); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/mutability/ReaugmentTask.java b/core/deployment/src/main/java/io/quarkus/deployment/mutability/ReaugmentTask.java index c22d2b644ed010..6037be04cd1da0 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/mutability/ReaugmentTask.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/mutability/ReaugmentTask.java @@ -40,7 +40,7 @@ public static void main(Path appRoot) throws Exception { List additional = new ArrayList<>(); if (appModel.getUserProvidersDirectory() != null) { - System.setProperty("quarkus.package.user-providers-directory", appModel.getUserProvidersDirectory()); //bit of a hack, but keeps things simple + System.setProperty("quarkus.package.jar.user-providers-directory", appModel.getUserProvidersDirectory()); //bit of a hack, but keeps things simple try (Stream files = Files.list(appRoot.resolve(appModel.getUserProvidersDirectory()))) { files.forEach(new Consumer() { @Override @@ -54,7 +54,7 @@ public void accept(Path path) { } final ApplicationModel existingModel = appModel.getAppModel(appRoot); - System.setProperty("quarkus.package.type", "mutable-jar"); + System.setProperty("quarkus.package.jar.type", "mutable-jar"); try (CuratedApplication bootstrap = QuarkusBootstrap.builder() .setAppArtifact(existingModel.getAppArtifact()) .setExistingModel(existingModel) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/ManifestConfig.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/ManifestConfig.java deleted file mode 100644 index 36c801240e8dad..00000000000000 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/ManifestConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.quarkus.deployment.pkg; - -import java.util.Map; - -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; - -@ConfigGroup -public class ManifestConfig { - - /** - * If the Implementation information should be included in the runner jar's MANIFEST.MF. - */ - @ConfigItem(defaultValue = "true") - public boolean addImplementationEntries; - - /** - * Custom manifest attributes to be added to the main section of the MANIFEST.MF file. - * An example of the user defined property: - * quarkus.package.manifest.attributes."Entry-key1"=Value1 - * quarkus.package.manifest.attributes."Entry-key2"=Value2 - */ - @ConfigItem() - public Map attributes; - - /** - * Custom manifest sections to be added to the MANIFEST.MF file. - * An example of the user defined property: - * quarkus.package.manifest.manifest-sections."Section-Name"."Entry-Key1"=Value1 - * quarkus.package.manifest.manifest-sections."Section-Name"."Entry-Key2"=Value2 - */ - @ConfigItem() - public Map> manifestSections; -} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java index 9b193308ec9f6f..badd6a7c63343c 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java @@ -23,6 +23,18 @@ public interface NativeConfig { String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21"; String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21"; + /** + * Set to enable native-image building using GraalVM. + */ + @WithDefault("false") + boolean enabled(); + + /** + * Set to prevent the native-image process from actually building the native image. + */ + @WithDefault("false") + boolean sourcesOnly(); + /** * Comma-separated, additional arguments to pass to the build process. * If an argument includes the {@code ,} symbol, it needs to be escaped, e.g. {@code \\,} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/PackageConfig.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/PackageConfig.java index a38ed23b1ecd78..b46a36750613cd 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/PackageConfig.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/PackageConfig.java @@ -1,120 +1,29 @@ package io.quarkus.deployment.pkg; +import java.nio.file.Path; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.stream.Collectors; +import io.quarkus.maven.dependency.GACT; import io.quarkus.runtime.annotations.ConfigDocDefault; import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithDefault; +/** + * Configuration relating to creating a packaged output. + */ +@ConfigMapping(prefix = "quarkus.package") @ConfigRoot -public class PackageConfig { - - /** - * @deprecated Use {@link BuiltInType#JAR} instead - */ - @Deprecated - public static final String JAR = BuiltInType.JAR.value; - /** - * @deprecated Use {@link BuiltInType#UBER_JAR} instead - */ - @Deprecated - public static final String UBER_JAR = BuiltInType.UBER_JAR.value; - /** - * @deprecated Use {@link BuiltInType#FAST_JAR} instead - */ - @Deprecated - public static final String FAST_JAR = BuiltInType.FAST_JAR.value; - /** - * @deprecated Use {@link BuiltInType#MUTABLE_JAR} instead - */ - @Deprecated - public static final String MUTABLE_JAR = BuiltInType.MUTABLE_JAR.value; +public interface PackageConfig { /** - * @deprecated use 'legacy-jar' instead - */ - @Deprecated - public static final String LEGACY = BuiltInType.LEGACY.value; - /** - * @deprecated Use {@link BuiltInType#LEGACY_JAR} instead - */ - @Deprecated - public static final String LEGACY_JAR = BuiltInType.LEGACY_JAR.value; - /** - * @deprecated Use {@link BuiltInType#NATIVE} instead - */ - @Deprecated - public static final String NATIVE = BuiltInType.NATIVE.value; - /** - * @deprecated Use {@link BuiltInType#NATIVE_SOURCES} instead - */ - @Deprecated - // does everything 'native' but stops short of actually executing the 'native-image' command - public static final String NATIVE_SOURCES = BuiltInType.NATIVE_SOURCES.value; - - public enum BuiltInType { - JAR("jar"), - UBER_JAR("uber-jar"), - FAST_JAR("fast-jar"), - MUTABLE_JAR("mutable-jar"), - /** - * @deprecated use {@link #LEGACY_JAR} instead - */ - @Deprecated - LEGACY("legacy"), - LEGACY_JAR("legacy-jar"), - NATIVE("native"), - // does everything 'native' but stops short of actually executing the 'native-image' command - NATIVE_SOURCES("native-sources"); - - private final String value; - - private BuiltInType(final String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - public static BuiltInType fromString(String value) { - for (PackageConfig.BuiltInType type : values()) { - if (type.toString().equals(value)) { - return type; - } - } - throw new IllegalArgumentException("Unknown Quarkus package type '" + value + "'"); - } - } - - /** - * The requested output type. - *

- * The default built in types are 'jar' (which will use 'fast-jar'), 'legacy-jar' for the pre-1.12 default jar - * packaging, 'uber-jar', 'mutable-jar' (for remote development mode), 'native' and 'native-sources'. + * Configuration which applies to building a JAR file for the project. */ - @ConfigItem(defaultValue = "jar") - public String type; - - /** - * Whether the created jar will be compressed. This setting is not used when building a native image - */ - @ConfigItem - @ConfigDocDefault("false") - public Optional compressJar; - - /** - * Manifest configuration of the runner jar. - */ - @ConfigItem - public ManifestConfig manifest; + JarConfig jar(); /** * The entry point of the application. This can either be a fully qualified name of a standard Java @@ -124,215 +33,323 @@ public static BuiltInType fromString(String value) { * then this can also reference the name given in the annotation, to avoid the need to specify fully qualified * names in the config. */ - @ConfigItem - public Optional mainClass; + Optional mainClass(); /** - * Files that should not be copied to the output artifact + * The directory into which the output package(s) should be written. + * Relative paths are resolved from the build systems target directory. */ - @ConfigItem - public Optional> userConfiguredIgnoredEntries; + Optional outputDirectory(); /** - * List of all the dependencies that have been defined as optional to include into the final package of the application. - * Each optional dependency needs to be expressed in the following format: - *

- * groupId:artifactId:classifier:type - *

- * With the classifier and type being optional. - *

- * If the type is missing, the artifact is assumed to be of type {@code jar}. - *

- * This parameter is optional, if absent, no optional dependencies will be included into the final package of - * the application. - *

- * For backward compatibility reasons, this parameter is ignored by default and can be enabled by setting the - * parameter {@code quarkus.package.filter-optional-dependencies} to {@code true}. - *

- * This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final - * package with unused dependencies. + * The name of the final artifact, excluding the suffix and file extension. */ - @ConfigItem - public Optional> includedOptionalDependencies; + Optional outputName(); /** - * Flag indicating whether the optional dependencies should be filtered out or not. + * Setting this switch to {@code true} will cause Quarkus to write the transformed application bytecode + * to the build tool's output directory. + * This is useful for post-build tools that need to scan the application bytecode (for example, offline code-coverage + * tools). + *

+ * For example, if using Maven, enabling this feature will result in the classes in {@code target/classes} being + * replaced with classes that have been transformed by Quarkus. *

- * This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final - * package with unused dependencies. + * Setting this to {@code true}, however, should be done with a lot of caution and only if subsequent builds are done + * in a clean environment (i.e. the build tool's output directory has been completely cleaned). */ - @ConfigItem(defaultValue = "false") - public boolean filterOptionalDependencies; + @WithDefault("false") + boolean writeTransformedBytecodeToBuildOutput(); /** - * The suffix that is applied to the runner jar and native images + * The suffix that is applied to the runner artifact's base file name. */ - @ConfigItem(defaultValue = "-runner") - public String runnerSuffix; + @WithDefault("-runner") + String runnerSuffix(); /** - * Indicates whether the generated binary file (uber-jar or native image) should have the runner suffix appended. - * Turning off the runner suffix in case of the uber-jar package type, the original build system (Maven, Gradle, etc) - * built JAR will be replaced with the Quarkus built uber JAR. + * {@return the runner suffix if addRunnerSuffix is true, or an empty string otherwise} */ - @ConfigItem(defaultValue = "true") - public boolean addRunnerSuffix; + default String computedRunnerSuffix() { + return jar().addRunnerSuffix() ? runnerSuffix() : ""; + } /** - * The output folder in which to place the output, this is resolved relative to the build - * systems target directory. + * Configuration for creating packages as JARs. */ - @ConfigItem - public Optional outputDirectory; + @ConfigGroup + interface JarConfig { + /** + * If set to false, no JAR will be produced. + */ + @WithDefault("true") + boolean enabled(); - /** - * The name of the final artifact - */ - @ConfigItem - public Optional outputName; + /** + * The JAR output type to use. + */ + @WithDefault("fast-jar") + JarType type(); - /** - * Whether to automate the creation of AppCDS. This has no effect when a native binary is needed and will be ignored in - * that case. - * Furthermore, this option only works for Java 11+ and is considered experimental for the time being. - * Finally, care must be taken to use the same exact JVM version when building and running the application. - */ - @ConfigItem - public boolean createAppcds; + /** + * Whether the created jar will be compressed. This setting is not used when building a native image + */ + @ConfigDocDefault("true") + @WithDefault("true") + boolean compress(); - /** - * When AppCDS generation is enabled, if this property is set, then the JVM used to generate the AppCDS file - * will be the JVM present in the container image. The builder image is expected to have the 'java' binary - * on its PATH. - * This flag is useful when the JVM to be used at runtime is not the same exact JVM version as the one used to build - * the jar. - * Note that this property is consulted only when {@code quarkus.package.create-appcds=true} and it requires having - * docker available during the build. - */ - @ConfigItem - public Optional appcdsBuilderImage; + /** + * The JAR's manifest sub-configuration. + */ + ManifestConfig manifest(); - /** - * Whether creation of the AppCDS archive should run in a container if available. - * - *

- * Normally, if either a suitable container image to create the AppCDS archive inside of - * can be determined automatically or if one is explicitly set using the - * {@code quarkus.package.appcds-builder-image} setting, the AppCDS archive is generated by - * running the JDK contained in the image as a container. - * - *

- * If this option is set to {@code false}, a container will not be used to generate the - * AppCDS archive. Instead, the JDK used to build the application is also used to create the - * archive. Note that the exact same JDK version must be used to run the application in this - * case. - * - *

- * Ignored if {@code quarkus.package.create-appcds} is set to {@code false}. - */ - @ConfigItem(defaultValue = "true") - public boolean appcdsUseContainer; + /** + * Files that should not be copied to the output artifact. + */ + Optional> userConfiguredIgnoredEntries(); - /** - * This is an advanced option that only takes effect for the mutable-jar format. - *

- * If this is specified a directory of this name will be created in the jar distribution. Users can place - * jar files in this directory, and when re-augmentation is performed these will be processed and added to the - * class-path. - *

- * Note that before reaugmentation has been performed these jars will be ignored, and if they are updated the app - * should be reaugmented again. - */ - @ConfigItem - public Optional userProvidersDirectory; + /** + * List of all the dependencies that have been defined as optional to include into the final package of the application. + * Each optional dependency needs to be expressed in the following format: + *

+ * {@code groupId:artifactId[:[classifier][:[type]]]} + *

+ * With the classifier and type being optional (note that the brackets ({@code []}) denote optionality and are + * not a part of the syntax specification). + * The group ID and artifact ID must be present and non-empty. + *

+ * If the type is missing, the artifact is assumed to be of type {@code jar}. + *

+ * This parameter is optional; if absent, no optional dependencies will be included into the final package of + * the application. + *

+ * For backward compatibility reasons, this parameter is ignored by default and can be enabled by setting the + * parameter {@code quarkus.package.jar.filter-optional-dependencies} to {@code true}. + *

+ * This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final + * package with unused dependencies. + */ + Optional> includedOptionalDependencies(); - /** - * This option only applies when using fast-jar or mutable-jar. If this option is true - * then a list of all the coordinates of the artifacts that made up this image will be included - * in the quarkus-app directory. This list can be used by vulnerability scanners to determine - * if your application has any vulnerable dependencies. - */ - @ConfigItem(defaultValue = "true") - public boolean includeDependencyList; + /** + * Flag indicating whether the optional dependencies should be filtered out or not. + *

+ * This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final + * package with unused dependencies. + */ + @WithDefault("false") + boolean filterOptionalDependencies(); - /** - * Vineflower Decompiler configuration - * - * @Deprecated use {@code quarkus.package.decompiler} instead - */ - @ConfigItem - @Deprecated(forRemoval = true) - public DecompilerConfig vineflower; + /** + * Indicates whether the generated JAR file should have the runner suffix appended. + * Only applicable to the {@linkplain JarType#UBER_JAR uber-JAR output type}. + * If disabled, the JAR built by the original build system (Maven, Gradle, etc.) + * will be replaced with the Quarkus-built uber-JAR. + */ + @WithDefault("true") + boolean addRunnerSuffix(); - /** - * Decompiler configuration - */ - @ConfigItem - public DecompilerConfig decompiler; + /** + * AppCDS archive sub-configuration. + * This configuration only applies to certain JAR types. + */ + AppcdsConfig appcds(); - /** - * If set to {@code true}, it will result in the Quarkus writing the transformed application bytecode - * to the build tool's output directory. - * This is useful for post-build tools that need to scan the application bytecode - for example for offline - * code-coverage tools. - * - * For example, if using Maven, enabling this feature will result in the classes in {@code target/classes} being - * updated with the versions that result after Quarkus has applied its transformations. - * - * Setting this to {@code true} however, should be done with a lot of caution and only if subsequent builds are done - * in a clean environment (i.e. the build tool's output directory has been completely cleaned). - */ - @ConfigItem - public boolean writeTransformedBytecodeToBuildOutput; - - public boolean isAnyJarType() { - return (type.equalsIgnoreCase(PackageConfig.BuiltInType.JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.FAST_JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.UBER_JAR.getValue())) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.LEGACY_JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.LEGACY.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.MUTABLE_JAR.getValue()); - } + /** + * Configuration for AppCDS generation. + */ + @ConfigGroup + interface AppcdsConfig { + /** + * Whether to automate the creation of AppCDS. + * Furthermore, this option only works for Java 11+ and is considered experimental for the time being. + * Finally, care must be taken to use the same exact JVM version when building and running the application. + */ + @WithDefault("false") + boolean enabled(); + + /** + * When AppCDS generation is enabled, if this property is set, then the JVM used to generate the AppCDS file + * will be the JVM present in the container image. The builder image is expected to have the 'java' binary + * on its PATH. + * This flag is useful when the JVM to be used at runtime is not the same exact JVM version as the one used to build + * the jar. + * Note that this property is consulted only when {@code quarkus.package.jar.appcds.enabled=true} and it requires + * having + * docker available during the build. + */ + Optional builderImage(); + + /** + * Whether creation of the AppCDS archive should run in a container if available. + * + *

+ * Normally, if either a suitable container image to use to create the AppCDS archive + * can be determined automatically or if one is explicitly set using the + * {@code quarkus..appcds.builder-image} setting, the AppCDS archive is generated by + * running the JDK contained in the image as a container. + * + *

+ * If this option is set to {@code false}, a container will not be used to generate the + * AppCDS archive. Instead, the JDK used to build the application is also used to create the + * archive. Note that the exact same JDK version must be used to run the application in this + * case. + * + *

+ * Ignored if {@code quarkus.package.jar.appcds.enabled} is set to {@code false}. + */ + @WithDefault("true") + boolean useContainer(); + } - public boolean isFastJar() { - return type.equalsIgnoreCase(PackageConfig.BuiltInType.JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.FAST_JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.MUTABLE_JAR.getValue()); - } + /** + * This is an advanced option that only takes effect for development mode. + *

+ * If this is specified a directory of this name will be created in the jar distribution. Users can place + * jar files in this directory, and when re-augmentation is performed these will be processed and added to the + * class-path. + *

+ * Note that before reaugmentation has been performed these jars will be ignored, and if they are updated the app + * should be reaugmented again. + */ + Optional userProvidersDirectory(); - public boolean isLegacyJar() { - return (type.equalsIgnoreCase(PackageConfig.BuiltInType.LEGACY_JAR.getValue()) || - type.equalsIgnoreCase(PackageConfig.BuiltInType.LEGACY.getValue())); - } + /** + * If this option is true then a list of all the coordinates of the artifacts that made up this image will be included + * in the quarkus-app directory. This list can be used by vulnerability scanners to determine + * if your application has any vulnerable dependencies. + * Only supported for the {@linkplain JarType#FAST_JAR fast JAR} and {@linkplain JarType#MUTABLE_JAR mutable JAR} + * output types. + */ + @WithDefault("true") + boolean includeDependencyList(); - public boolean isUberJar() { - return type.equalsIgnoreCase(PackageConfig.BuiltInType.UBER_JAR.getValue()); - } + /** + * Decompiler configuration + */ + DecompilerConfig decompiler(); - public boolean isNativeOrNativeSources() { - return type.equalsIgnoreCase(PackageConfig.BuiltInType.NATIVE.getValue()) - || type.equalsIgnoreCase(PackageConfig.BuiltInType.NATIVE_SOURCES.getValue()); - } + /** + * Configuration which applies to the JAR's manifest. + */ + @ConfigGroup + interface ManifestConfig { + /** + * Specify whether the `Implementation` information should be included in the runner jar's MANIFEST.MF. + */ + @WithDefault("true") + boolean addImplementationEntries(); + + /** + * Custom manifest attributes to be added to the main section of the MANIFEST.MF file. + * An example of the user defined property: + * quarkus.package.jar.manifest.attributes."Entry-key1"=Value1 + * quarkus.package.jar.manifest.attributes."Entry-key2"=Value2 + */ + Map attributes(); + + /** + * Custom manifest sections to be added to the MANIFEST.MF file. + * An example of the user defined property: + * quarkus.package.jar.manifest.sections."Section-Name"."Entry-Key1"=Value1 + * quarkus.package.jar.manifest.sections."Section-Name"."Entry-Key2"=Value2 + */ + Map> sections(); + } + + /** + * The possible packaging options for JAR output. + */ + enum JarType { + /** + * The "fast JAR" packaging type. + */ + FAST_JAR("fast-jar", "jar"), + /** + * The "Uber-JAR" packaging type. + */ + UBER_JAR("uber-jar"), + /** + * The "mutable JAR" packaging type (for remote development mode). + */ + MUTABLE_JAR("mutable-jar"), + /** + * The "legacy JAR" packaging type. + * This corresponds to the packaging type used in Quarkus before version 1.12. + * + * @deprecated This packaging type is no longer recommended for use. + */ + @Deprecated + LEGACY_JAR("legacy-jar", "legacy"), + ; + + public static final List values = List.of(JarType.values()); + + private static final Map byName = values.stream() + .flatMap(item -> item.names.stream().map(name -> Map.entry(name, item))) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + + private final List names; + + JarType(final List names) { + this.names = names; + } + + JarType(final String... names) { + this(List.of(names)); + } + + JarType(final String name) { + this(List.of(name)); + } + + /** + * {@return the names for this output type} + * The first name is the "canonical" name. + */ + public List names() { + return names; + } + + /** + * {@return the name of this output type} + */ + @Override + public String toString() { + return names.get(0); + } - public String getRunnerSuffix() { - return addRunnerSuffix ? runnerSuffix : ""; + /** + * {@return the JarType for the given string} + * + * @param value the string to look up + * @throws IllegalArgumentException if the string does not correspond to a valid JAR type + */ + public static JarType fromString(String value) { + JarType jarOutputType = byName.get(value); + if (jarOutputType == null) { + throw new IllegalArgumentException("Unknown JAR package type '" + value + "'"); + } + return jarOutputType; + } + } } + /** + * Configuration for the decompiler. + */ @ConfigGroup - public static class DecompilerConfig { + interface DecompilerConfig { /** - * An advanced option that will decompile generated and transformed bytecode into the 'decompiled' directory. - * This is only taken into account when fast-jar is used. + * Enable decompilation of generated and transformed bytecode into the `decompiled` directory. */ - @ConfigItem - @ConfigDocDefault("false") - public Optional enabled; + @WithDefault("false") + boolean enabled(); /** - * The directory into which to save the Vineflower tool if it doesn't exist + * The directory into which to save the decompilation tool if it doesn't exist locally. */ - @ConfigItem - @ConfigDocDefault("${user.home}/.quarkus") - public Optional jarDirectory; + @WithDefault("${user.home}/.quarkus") + String jarDirectory(); } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JarBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JarBuildItem.java index 5db2a885bee756..8eb4a30d84d435 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JarBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JarBuildItem.java @@ -1,19 +1,23 @@ package io.quarkus.deployment.pkg.builditem; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; + import java.nio.file.Path; import io.quarkus.bootstrap.app.JarResult; import io.quarkus.builder.item.SimpleBuildItem; +import io.quarkus.deployment.pkg.PackageConfig; public final class JarBuildItem extends SimpleBuildItem { private final Path path; private final Path originalArtifact; private final Path libraryDir; - private final String type; + private final PackageConfig.JarConfig.JarType type; private final String classifier; - public JarBuildItem(Path path, Path originalArtifact, Path libraryDir, String type, String classifier) { + public JarBuildItem(Path path, Path originalArtifact, Path libraryDir, PackageConfig.JarConfig.JarType type, + String classifier) { this.path = path; this.originalArtifact = originalArtifact; this.libraryDir = libraryDir; @@ -37,7 +41,7 @@ public Path getOriginalArtifact() { return originalArtifact; } - public String getType() { + public PackageConfig.JarConfig.JarType getType() { return type; } @@ -46,6 +50,7 @@ public String getClassifier() { } public JarResult toJarResult() { - return new JarResult(path, originalArtifact, libraryDir, type, classifier); + return new JarResult(path, originalArtifact, libraryDir, type == MUTABLE_JAR, + classifier); } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/LegacyJarRequiredBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/LegacyJarRequiredBuildItem.java index 7a337c2e7194b6..7f124232b191b5 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/LegacyJarRequiredBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/LegacyJarRequiredBuildItem.java @@ -5,5 +5,6 @@ /** * marker build item that extensions can use to force legacy jar creation */ +@Deprecated public final class LegacyJarRequiredBuildItem extends MultiBuildItem { } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/OutputTargetBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/OutputTargetBuildItem.java index 6eb601ace4e1d9..3a513ea0196a10 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/OutputTargetBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/OutputTargetBuildItem.java @@ -9,9 +9,7 @@ import io.quarkus.maven.dependency.ArtifactKey; /** - * The location that output artifacts should be created in - * - * TODO: should we just create them in temp directories, and leave it up to the integration to move them where they want? + * The location that output artifacts should be created in. */ public final class OutputTargetBuildItem extends SimpleBuildItem { @@ -63,7 +61,7 @@ public String getBaseName() { /** * The base name (not including the extension) of the original JAR generated by the build system. - * This name could be different from the value of {@ #getBaseName()}, which will be used for the Quarkus runner file. + * This name could be different from the value of {@link #getBaseName()}, which will be used for the Quarkus runner file. * * @return name of the original JAR generated by the build system */ diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/PackageTypeBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/PackageTypeBuildItem.java index d8e85441fa14e5..7d2c135ab9ffd4 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/PackageTypeBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/PackageTypeBuildItem.java @@ -3,9 +3,9 @@ import io.quarkus.builder.item.MultiBuildItem; /** - * Build item that extensions must create to register a package type. This allows for verification - * that a request package type can actually be produced + * @deprecated Ignored. */ +@Deprecated(forRemoval = true) public final class PackageTypeBuildItem extends MultiBuildItem { private final String type; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/UberJarRequiredBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/UberJarRequiredBuildItem.java index 0867ca7ce094cf..c0fc2aa08c30f8 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/UberJarRequiredBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/UberJarRequiredBuildItem.java @@ -5,5 +5,6 @@ /** * marker build item that extensions can use to force uber jar creation */ +@Deprecated public final class UberJarRequiredBuildItem extends MultiBuildItem { } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java index 3075fc40632d2d..12bbefbc612223 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/AppCDSBuildStep.java @@ -1,5 +1,6 @@ package io.quarkus.deployment.pkg.steps; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.deployment.pkg.steps.LinuxIDUtil.getLinuxID; import static io.quarkus.deployment.util.ContainerRuntimeUtil.detectContainerRuntime; @@ -56,7 +57,7 @@ public void build(Optional appCDsRequested, Optional appCDSContainerImage, BuildProducer appCDS, BuildProducer artifactResult) throws Exception { - if (!appCDsRequested.isPresent()) { + if (appCDsRequested.isEmpty()) { return; } @@ -77,8 +78,9 @@ public void build(Optional appCDsRequested, Path appCDSPath; log.info("Launching AppCDS creation process."); + boolean isFastJar = packageConfig.jar().type() == FAST_JAR; appCDSPath = createAppCDSFromExit(jarResult, outputTarget, javaBinPath, containerImage, - packageConfig.isFastJar()); + isFastJar); if (appCDSPath == null) { log.warn("Unable to create AppCDS."); @@ -100,10 +102,10 @@ public void build(Optional appCDsRequested, private String determineContainerImage(PackageConfig packageConfig, Optional appCDSContainerImage) { - if (!packageConfig.appcdsUseContainer) { + if (!packageConfig.jar().appcds().useContainer()) { return null; - } else if (packageConfig.appcdsBuilderImage.isPresent()) { - return packageConfig.appcdsBuilderImage.get(); + } else if (packageConfig.jar().appcds().builderImage().isPresent()) { + return packageConfig.jar().appcds().builderImage().get(); } else if (appCDSContainerImage.isPresent()) { return appCDSContainerImage.get().getContainerImage(); } @@ -356,11 +358,7 @@ public boolean getAsBoolean() { return false; } - if (!packageConfig.createAppcds || !packageConfig.isAnyJarType()) { - return false; - } - - return true; + return packageConfig.jar().appcds().enabled() && packageConfig.jar().enabled(); } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java index eab173ac613a86..159d30601bf34d 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java @@ -1,5 +1,6 @@ package io.quarkus.deployment.pkg.steps; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.fs.util.ZipUtils.wrapForJDK8232879; import java.io.BufferedInputStream; @@ -158,13 +159,13 @@ public boolean test(String path) { @BuildStep OutputTargetBuildItem outputTarget(BuildSystemTargetBuildItem bst, PackageConfig packageConfig) { - String name = packageConfig.outputName.orElseGet(bst::getBaseName); - Path path = packageConfig.outputDirectory.map(s -> bst.getOutputDirectory().resolve(s)) + String name = packageConfig.outputName().orElseGet(bst::getBaseName); + Path path = packageConfig.outputDirectory().map(s -> bst.getOutputDirectory().resolve(s)) .orElseGet(bst::getOutputDirectory); Optional> includedOptionalDependencies; - if (packageConfig.filterOptionalDependencies) { - includedOptionalDependencies = Optional.of(packageConfig.includedOptionalDependencies - .map(set -> set.stream().map(s -> ArtifactKey.fromString(s)).collect(Collectors.toSet())) + if (packageConfig.jar().filterOptionalDependencies()) { + includedOptionalDependencies = Optional.of(packageConfig.jar().includedOptionalDependencies() + .map(set -> set.stream().map(ArtifactKey.class::cast).collect(Collectors.toSet())) .orElse(Collections.emptySet())); } else { includedOptionalDependencies = Optional.empty(); @@ -176,13 +177,14 @@ OutputTargetBuildItem outputTarget(BuildSystemTargetBuildItem bst, PackageConfig @BuildStep(onlyIf = JarRequired.class) ArtifactResultBuildItem jarOutput(JarBuildItem jarBuildItem) { if (jarBuildItem.getLibraryDir() != null) { - return new ArtifactResultBuildItem(jarBuildItem.getPath(), PackageConfig.JAR, + return new ArtifactResultBuildItem(jarBuildItem.getPath(), "jar", Collections.singletonMap("library-dir", jarBuildItem.getLibraryDir().toString())); } else { - return new ArtifactResultBuildItem(jarBuildItem.getPath(), PackageConfig.JAR, Collections.emptyMap()); + return new ArtifactResultBuildItem(jarBuildItem.getPath(), "jar", Collections.emptyMap()); } } + @SuppressWarnings("deprecation") // JarType#LEGACY_JAR @BuildStep public JarBuildItem buildRunnerJar(CurateOutcomeBuildItem curateOutcomeBuildItem, OutputTargetBuildItem outputTargetBuildItem, @@ -211,18 +213,19 @@ public JarBuildItem buildRunnerJar(CurateOutcomeBuildItem curateOutcomeBuildItem } if (legacyJarRequired.isEmpty() && (!uberJarRequired.isEmpty() - || packageConfig.type.equalsIgnoreCase(PackageConfig.BuiltInType.UBER_JAR.getValue()))) { + || packageConfig.jar().type() == UBER_JAR)) { return buildUberJar(curateOutcomeBuildItem, outputTargetBuildItem, transformedClasses, applicationArchivesBuildItem, packageConfig, applicationInfo, generatedClasses, generatedResources, uberJarMergedResourceBuildItems, uberJarIgnoredResourceBuildItems, mainClassBuildItem, classLoadingConfig); - } else if (!legacyJarRequired.isEmpty() || packageConfig.isLegacyJar()) { + } else if (!legacyJarRequired.isEmpty() || packageConfig.jar().type() == LEGACY_JAR) { return buildLegacyThinJar(curateOutcomeBuildItem, outputTargetBuildItem, transformedClasses, applicationArchivesBuildItem, packageConfig, applicationInfo, generatedClasses, generatedResources, mainClassBuildItem, classLoadingConfig); } else { return buildThinJar(curateOutcomeBuildItem, outputTargetBuildItem, transformedClasses, applicationArchivesBuildItem, - packageConfig, classLoadingConfig, applicationInfo, generatedClasses, generatedResources, + packageConfig, classLoadingConfig, applicationInfo, generatedClasses, + generatedResources, additionalApplicationArchiveBuildItems, mainClassBuildItem); } } @@ -270,7 +273,7 @@ private JarBuildItem buildUberJar(CurateOutcomeBuildItem curateOutcomeBuildItem, //we use the -runner jar name, unless we are building both types final Path runnerJar = outputTargetBuildItem.getOutputDirectory() - .resolve(outputTargetBuildItem.getBaseName() + packageConfig.getRunnerSuffix() + DOT_JAR); + .resolve(outputTargetBuildItem.getBaseName() + packageConfig.computedRunnerSuffix() + DOT_JAR); // If the runner jar appears to exist already we create a new one with a tmp suffix. // Deleting an existing runner jar may result in deleting the original (non-runner) jar (in case the runner suffix is empty) @@ -278,7 +281,7 @@ private JarBuildItem buildUberJar(CurateOutcomeBuildItem curateOutcomeBuildItem, final Path tmpRunnerJar; if (Files.exists(runnerJar)) { tmpRunnerJar = outputTargetBuildItem.getOutputDirectory() - .resolve(outputTargetBuildItem.getBaseName() + packageConfig.getRunnerSuffix() + ".tmp"); + .resolve(outputTargetBuildItem.getBaseName() + packageConfig.computedRunnerSuffix() + ".tmp"); Files.deleteIfExists(tmpRunnerJar); } else { tmpRunnerJar = runnerJar; @@ -308,8 +311,8 @@ private JarBuildItem buildUberJar(CurateOutcomeBuildItem curateOutcomeBuildItem, .resolve(outputTargetBuildItem.getOriginalBaseName() + DOT_JAR); final Path originalJar = Files.exists(standardJar) ? standardJar : null; - return new JarBuildItem(runnerJar, originalJar, null, PackageConfig.BuiltInType.UBER_JAR.getValue(), - suffixToClassifier(packageConfig.getRunnerSuffix())); + return new JarBuildItem(runnerJar, originalJar, null, UBER_JAR, + suffixToClassifier(packageConfig.computedRunnerSuffix())); } private String suffixToClassifier(String suffix) { @@ -342,7 +345,7 @@ private void buildUberJar0(CurateOutcomeBuildItem curateOutcomeBuildItem, final Set removed = getRemovedKeys(classLoadingConfig); Set ignoredEntries = new HashSet<>(); - packageConfig.userConfiguredIgnoredEntries.ifPresent(ignoredEntries::addAll); + packageConfig.jar().userConfiguredIgnoredEntries().ifPresent(ignoredEntries::addAll); ignoredResources.stream() .map(UberJarIgnoredResourceBuildItem::getPath) .forEach(ignoredEntries::add); @@ -525,7 +528,7 @@ private JarBuildItem buildLegacyThinJar(CurateOutcomeBuildItem curateOutcomeBuil ClassLoadingConfig classLoadingConfig) throws Exception { Path runnerJar = outputTargetBuildItem.getOutputDirectory() - .resolve(outputTargetBuildItem.getBaseName() + packageConfig.getRunnerSuffix() + DOT_JAR); + .resolve(outputTargetBuildItem.getBaseName() + packageConfig.computedRunnerSuffix() + DOT_JAR); Path libDir = outputTargetBuildItem.getOutputDirectory().resolve("lib"); Files.deleteIfExists(runnerJar); IoUtils.createOrEmptyDir(libDir); @@ -541,8 +544,8 @@ private JarBuildItem buildLegacyThinJar(CurateOutcomeBuildItem curateOutcomeBuil } runnerJar.toFile().setReadable(true, false); - return new JarBuildItem(runnerJar, null, libDir, PackageConfig.BuiltInType.LEGACY_JAR.getValue(), - suffixToClassifier(packageConfig.getRunnerSuffix())); + return new JarBuildItem(runnerJar, null, libDir, packageConfig.jar().type(), + suffixToClassifier(packageConfig.computedRunnerSuffix())); } @SuppressWarnings("deprecation") @@ -562,7 +565,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, Path buildDir; - if (packageConfig.outputDirectory.isPresent()) { + if (packageConfig.outputDirectory().isPresent()) { buildDir = outputTargetBuildItem.getOutputDirectory(); } else { buildDir = outputTargetBuildItem.getOutputDirectory().resolve(DEFAULT_FAST_JAR_DIRECTORY_NAME); @@ -578,8 +581,8 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, Path appDir = buildDir.resolve(APP); Path quarkus = buildDir.resolve(QUARKUS); Path userProviders = null; - if (packageConfig.userProvidersDirectory.isPresent()) { - userProviders = buildDir.resolve(packageConfig.userProvidersDirectory.get()); + if (packageConfig.jar().userProvidersDirectory().isPresent()) { + userProviders = buildDir.resolve(packageConfig.jar().userProvidersDirectory().get()); } if (!rebuild) { IoUtils.createOrEmptyDir(buildDir); @@ -604,17 +607,13 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, Path decompiledOutputDir = null; boolean wasDecompiledSuccessfully = true; Decompiler decompiler = null; - if (packageConfig.vineflower.enabled.orElse(false) || packageConfig.decompiler.enabled.orElse(false)) { - Optional jarDirectoryStrOpt = packageConfig.vineflower.enabled.orElse(false) - ? packageConfig.vineflower.jarDirectory - : packageConfig.decompiler.jarDirectory; - String jarDirectoryStr = jarDirectoryStrOpt.orElse(System.getProperty("user.home") + "/.quarkus"); - + PackageConfig.DecompilerConfig decompilerConfig = packageConfig.jar().decompiler(); + if (decompilerConfig.enabled()) { decompiledOutputDir = buildDir.getParent().resolve("decompiled"); FileUtil.deleteDirectory(decompiledOutputDir); Files.createDirectory(decompiledOutputDir); decompiler = new Decompiler.VineflowerDecompiler(); - Path jarDirectory = Paths.get(jarDirectoryStr); + Path jarDirectory = Paths.get(decompilerConfig.jarDirectory()); if (!Files.exists(jarDirectory)) { Files.createDirectory(jarDirectory); } @@ -752,7 +751,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, runnerJar.toFile().setReadable(true, false); Path initJar = buildDir.resolve(QUARKUS_RUN_JAR); - boolean mutableJar = packageConfig.type.equalsIgnoreCase(PackageConfig.BuiltInType.MUTABLE_JAR.getValue()); + boolean mutableJar = packageConfig.jar().type() == MUTABLE_JAR; if (mutableJar) { //we output the properties in a reproducible manner, so we remove the date comment //and sort them @@ -797,7 +796,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, MutableJarApplicationModel model = new MutableJarApplicationModel(outputTargetBuildItem.getBaseName(), relativePaths, curateOutcomeBuildItem.getApplicationModel(), - packageConfig.userProvidersDirectory.orElse(null), buildDir.relativize(runnerJar).toString()); + packageConfig.jar().userProvidersDirectory().orElse(null), buildDir.relativize(runnerJar).toString()); Path appmodelDat = deploymentLib.resolve(APPMODEL_DAT); try (OutputStream out = Files.newOutputStream(appmodelDat)) { ObjectOutputStream obj = new ObjectOutputStream(out); @@ -824,7 +823,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, } } - if (packageConfig.includeDependencyList) { + if (packageConfig.jar().includeDependencyList()) { Path deplist = buildDir.resolve(QUARKUS_APP_DEPS); List lines = new ArrayList<>(); for (ResolvedDependency i : curateOutcomeBuildItem.getApplicationModel().getRuntimeDependencies()) { @@ -844,7 +843,7 @@ public void accept(Path path) { } }); } - return new JarBuildItem(initJar, null, libDir, packageConfig.type, null); + return new JarBuildItem(initJar, null, libDir, packageConfig.jar().type(), null); } /** @@ -1000,7 +999,7 @@ private NativeImageSourceJarBuildItem buildNativeImageThinJar(CurateOutcomeBuild copyJsonConfigFiles(applicationArchivesBuildItem, targetDirectory); Path runnerJar = targetDirectory - .resolve(outputTargetBuildItem.getBaseName() + packageConfig.getRunnerSuffix() + DOT_JAR); + .resolve(outputTargetBuildItem.getBaseName() + packageConfig.computedRunnerSuffix() + DOT_JAR); Path libDir = targetDirectory.resolve(LIB); Files.createDirectories(libDir); @@ -1288,42 +1287,40 @@ private void generateManifest(FileSystem runnerZipFs, final String classPath, Pa Attributes attributes = manifest.getMainAttributes(); attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0"); - if (config.manifest.attributes.size() > 0) { - for (Map.Entry attribute : config.manifest.attributes.entrySet()) { - attributes.putValue(attribute.getKey(), attribute.getValue()); - } + for (Map.Entry attribute : config.jar().manifest().attributes().entrySet()) { + attributes.putValue(attribute.getKey(), attribute.getValue()); } if (attributes.containsKey(Attributes.Name.CLASS_PATH)) { log.warn( - "A CLASS_PATH entry was already defined in your MANIFEST.MF or using the property quarkus.package.manifest.attributes.\"Class-Path\". Quarkus has overwritten this existing entry."); + "A CLASS_PATH entry was already defined in your MANIFEST.MF or using the property quarkus.package.jar.manifest.attributes.\"Class-Path\". Quarkus has overwritten this existing entry."); } attributes.put(Attributes.Name.CLASS_PATH, classPath); if (attributes.containsKey(Attributes.Name.MAIN_CLASS)) { String existingMainClass = attributes.getValue(Attributes.Name.MAIN_CLASS); if (!mainClassName.equals(existingMainClass)) { log.warn( - "A MAIN_CLASS entry was already defined in your MANIFEST.MF or using the property quarkus.package.manifest.attributes.\"Main-Class\". Quarkus has overwritten your existing entry."); + "A MAIN_CLASS entry was already defined in your MANIFEST.MF or using the property quarkus.package.jar.manifest.attributes.\"Main-Class\". Quarkus has overwritten your existing entry."); } } attributes.put(Attributes.Name.MAIN_CLASS, mainClassName); - if (config.manifest.addImplementationEntries && !attributes.containsKey(Attributes.Name.IMPLEMENTATION_TITLE)) { + if (config.jar().manifest().addImplementationEntries() + && !attributes.containsKey(Attributes.Name.IMPLEMENTATION_TITLE)) { String name = ApplicationInfoBuildItem.UNSET_VALUE.equals(applicationInfo.getName()) ? appArtifact.getArtifactId() : applicationInfo.getName(); attributes.put(Attributes.Name.IMPLEMENTATION_TITLE, name); } - if (config.manifest.addImplementationEntries && !attributes.containsKey(Attributes.Name.IMPLEMENTATION_VERSION)) { + if (config.jar().manifest().addImplementationEntries() + && !attributes.containsKey(Attributes.Name.IMPLEMENTATION_VERSION)) { String version = ApplicationInfoBuildItem.UNSET_VALUE.equals(applicationInfo.getVersion()) ? appArtifact.getVersion() : applicationInfo.getVersion(); attributes.put(Attributes.Name.IMPLEMENTATION_VERSION, version); } - if (config.manifest.manifestSections.size() > 0) { - for (String sectionName : config.manifest.manifestSections.keySet()) { - for (Map.Entry entry : config.manifest.manifestSections.get(sectionName).entrySet()) { - Attributes attribs = manifest.getEntries().computeIfAbsent(sectionName, k -> new Attributes()); - attribs.putValue(entry.getKey(), entry.getValue()); - } + for (String sectionName : config.jar().manifest().sections().keySet()) { + for (Map.Entry entry : config.jar().manifest().sections().get(sectionName).entrySet()) { + Attributes attribs = manifest.getEntries().computeIfAbsent(sectionName, k -> new Attributes()); + attribs.putValue(entry.getKey(), entry.getValue()); } } try (final OutputStream os = wrapForJDK8232879(Files.newOutputStream(manifestPath))) { @@ -1431,7 +1428,7 @@ static class JarRequired implements BooleanSupplier { @Override public boolean getAsBoolean() { - return packageConfig.isAnyJarType(); + return packageConfig.jar().enabled(); } } @@ -1447,23 +1444,7 @@ static boolean isBlockOrSF(final String s) { } private Predicate getThinJarIgnoredEntriesPredicate(PackageConfig packageConfig) { - if (packageConfig.userConfiguredIgnoredEntries.isEmpty()) { - return new Predicate() { - @Override - public boolean test(String path) { - return false; - } - }; - } - - Set ignoredEntries = new HashSet<>(packageConfig.userConfiguredIgnoredEntries.get()); - Predicate ignoredEntriesPredicate = new Predicate() { - @Override - public boolean test(String path) { - return ignoredEntries.contains(path); - } - }; - return ignoredEntriesPredicate; + return packageConfig.jar().userConfiguredIgnoredEntries().map(Set::copyOf).orElse(Set.of())::contains; } private static class IsEntryIgnoredForUberJarPredicate implements Predicate { @@ -1655,7 +1636,7 @@ public boolean decompile(Path jarToDecompile) { } private static FileSystem createNewZip(Path runnerJar, PackageConfig config) throws IOException { - boolean useUncompressedJar = config.compressJar.map(o -> !o).orElse(false); + boolean useUncompressedJar = !config.jar().compress(); if (useUncompressedJar) { return ZipUtils.newZip(runnerJar, Map.of("compressionMethod", "STORED")); } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeBuild.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeBuild.java index a1eb5ed568df5e..b8a82f21812c8e 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeBuild.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeBuild.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import io.quarkus.deployment.pkg.PackageConfig; +import io.quarkus.deployment.pkg.NativeConfig; /** * Supplier that can be used to only run build steps in the @@ -12,17 +12,20 @@ * the extension works properly when the build produces a {@code native-sources} artifact instead of a * native binary. * This build item should be used only when there is a real need for a step to run exclusively for a {@code native} build. + * + * @deprecated In the future, it will be possible to request multiple output types. */ +@Deprecated public class NativeBuild implements BooleanSupplier { - private final PackageConfig packageConfig; + private final NativeConfig nativeConfig; - NativeBuild(PackageConfig packageConfig) { - this.packageConfig = packageConfig; + public NativeBuild(final NativeConfig nativeConfig) { + this.nativeConfig = nativeConfig; } @Override public boolean getAsBoolean() { - return packageConfig.type.equalsIgnoreCase(PackageConfig.NATIVE); + return nativeConfig.enabled() && !nativeConfig.sourcesOnly(); } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index ccdd7ae667682a..f90e6a723152ca 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -87,7 +87,7 @@ void nativeImageFeatures(BuildProducer features) { @BuildStep(onlyIf = NativeBuild.class) ArtifactResultBuildItem result(NativeImageBuildItem image) { NativeImageBuildItem.GraalVMVersion graalVMVersion = image.getGraalVMInfo(); - return new ArtifactResultBuildItem(image.getPath(), PackageConfig.BuiltInType.NATIVE.getValue(), + return new ArtifactResultBuildItem(image.getPath(), "native", graalVMVersion.toMap()); } @@ -157,7 +157,7 @@ ArtifactResultBuildItem nativeSourcesResult(NativeConfig nativeConfig, IoUtils.recursiveDelete(nativeImageSourceJarBuildItem.getPath().getParent()); return new ArtifactResultBuildItem(nativeImageSourceJarBuildItem.getPath(), - PackageConfig.BuiltInType.NATIVE_SOURCES.getValue(), + "native-sources", Collections.emptyMap()); } @@ -308,7 +308,7 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, LocalesBuildTimeCon } private String getNativeImageName(OutputTargetBuildItem outputTargetBuildItem, PackageConfig packageConfig) { - return outputTargetBuildItem.getBaseName() + packageConfig.getRunnerSuffix(); + return outputTargetBuildItem.getBaseName() + packageConfig.computedRunnerSuffix(); } private String getResultingExecutableName(String nativeImageName, boolean isContainerBuild) { diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeOrNativeSourcesBuild.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeOrNativeSourcesBuild.java index 7e4e243172d0e6..8c37114411fe2e 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeOrNativeSourcesBuild.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeOrNativeSourcesBuild.java @@ -2,24 +2,26 @@ import java.util.function.BooleanSupplier; -import io.quarkus.deployment.pkg.PackageConfig; +import io.quarkus.deployment.pkg.NativeConfig; /** * Supplier that can be used to only run build steps in the * native or native sources builds. * Most build steps that need to be run conditionally should use this instead of {@link NativeBuild}. + * + * @deprecated In the future, it will be possible to request multiple output types. */ +@Deprecated public class NativeOrNativeSourcesBuild implements BooleanSupplier { - private final PackageConfig packageConfig; + private final NativeConfig nativeConfig; - NativeOrNativeSourcesBuild(PackageConfig packageConfig) { - this.packageConfig = packageConfig; + public NativeOrNativeSourcesBuild(final NativeConfig nativeConfig) { + this.nativeConfig = nativeConfig; } @Override public boolean getAsBoolean() { - return packageConfig.isNativeOrNativeSources(); + return nativeConfig.enabled(); } - } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeSourcesBuild.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeSourcesBuild.java index 8759e242ed9f23..7e535fdcc10660 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeSourcesBuild.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeSourcesBuild.java @@ -2,22 +2,25 @@ import java.util.function.BooleanSupplier; -import io.quarkus.deployment.pkg.PackageConfig; +import io.quarkus.deployment.pkg.NativeConfig; /** * Supplier that can be used to only run build steps in the * native sources build. + * + * @deprecated In the future, it will be possible to request multiple output types. */ +@Deprecated public class NativeSourcesBuild implements BooleanSupplier { - private final PackageConfig packageConfig; + private final NativeConfig nativeConfig; - NativeSourcesBuild(PackageConfig packageConfig) { - this.packageConfig = packageConfig; + public NativeSourcesBuild(final NativeConfig nativeConfig) { + this.nativeConfig = nativeConfig; } @Override public boolean getAsBoolean() { - return packageConfig.type.equalsIgnoreCase(PackageConfig.BuiltInType.NATIVE_SOURCES.getValue()); + return nativeConfig.enabled() && nativeConfig.sourcesOnly(); } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/PackageTypeVerificationBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/PackageTypeVerificationBuildStep.java deleted file mode 100644 index 7b987f9b9df22c..00000000000000 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/PackageTypeVerificationBuildStep.java +++ /dev/null @@ -1,37 +0,0 @@ -package io.quarkus.deployment.pkg.steps; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.ServiceStartBuildItem; -import io.quarkus.deployment.pkg.PackageConfig; -import io.quarkus.deployment.pkg.builditem.PackageTypeBuildItem; - -/** - * Verifies that the requested package type can actually be produced - */ -public class PackageTypeVerificationBuildStep { - - @BuildStep - List builtins() { - return List.of( - new PackageTypeBuildItem(PackageConfig.BuiltInType.NATIVE.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.NATIVE_SOURCES.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.JAR.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.FAST_JAR.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.LEGACY_JAR.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.UBER_JAR.getValue()), - new PackageTypeBuildItem(PackageConfig.BuiltInType.MUTABLE_JAR.getValue())); - } - - @BuildStep - ServiceStartBuildItem verify(List items, PackageConfig config) { - Set registered = items.stream().map(PackageTypeBuildItem::getType).collect(Collectors.toSet()); - if (!registered.contains(config.type)) { - throw new IllegalStateException("Unknown packaging type '" + config.type + "' known types are " + registered); - } - return null; - } -} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassTransformingBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassTransformingBuildStep.java index f9232542a3a8c4..363339d88abdc4 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassTransformingBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassTransformingBuildStep.java @@ -279,7 +279,7 @@ public TransformedClassesBuildItem.TransformedClass call() throws Exception { } } - if (packageConfig.writeTransformedBytecodeToBuildOutput && (launchMode.getLaunchMode() == LaunchMode.NORMAL)) { + if (packageConfig.writeTransformedBytecodeToBuildOutput() && (launchMode.getLaunchMode() == LaunchMode.NORMAL)) { // the idea here is to write the transformed classes into the build tool's output directory to make core coverage work for (Path path : archiveRoot.getRootDirectories()) { diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java index d181e33c5a1f74..e32a0ab978922c 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java @@ -376,12 +376,12 @@ public MainClassBuildItem mainClassBuildStep(BuildProducer PackageConfig.BuiltInType.fromString("not-a-package-type")) - .withMessage("Unknown Quarkus package type 'not-a-package-type'"); + assertThatIllegalArgumentException().isThrownBy(() -> PackageConfig.JarConfig.JarType.fromString("not-a-package-type")) + .withMessage("Unknown JAR package type 'not-a-package-type'"); } } diff --git a/core/deployment/src/test/java/io/quarkus/deployment/pkg/TestNativeConfig.java b/core/deployment/src/test/java/io/quarkus/deployment/pkg/TestNativeConfig.java index fab7177f696d0b..2cf219198444a2 100644 --- a/core/deployment/src/test/java/io/quarkus/deployment/pkg/TestNativeConfig.java +++ b/core/deployment/src/test/java/io/quarkus/deployment/pkg/TestNativeConfig.java @@ -22,6 +22,14 @@ public TestNativeConfig(String builderImage, ImagePullStrategy builderImagePull) this.builderImage = new TestBuildImageConfig(builderImage, builderImagePull); } + public boolean enabled() { + return true; + } + + public boolean sourcesOnly() { + return true; + } + @Override public Optional> additionalBuildArgs() { return Optional.empty(); diff --git a/devtools/cli/pom.xml b/devtools/cli/pom.xml index d732bbc7c05b39..a912ebdfb4613b 100644 --- a/devtools/cli/pom.xml +++ b/devtools/cli/pom.xml @@ -11,7 +11,7 @@ 4.0.0 - uber-jar + uber-jar quarkus-cli @@ -221,7 +221,7 @@ - native + true diff --git a/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java b/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java index cd7aff6f5b4c04..4267b079b59420 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java @@ -202,7 +202,8 @@ public BuildCommandArgs prepareAction(String action, BuildOptions buildOptions, args.add(action); if (buildOptions.buildNative) { - args.add("-Dquarkus.package.type=native"); + args.add("-Dquarkus.native.enabled=true"); + args.add("-Dquarkus.jar.enabled=false"); } if (buildOptions.skipTests()) { setSkipTests(args); diff --git a/devtools/cli/src/main/resources/application.properties b/devtools/cli/src/main/resources/application.properties index 85aa943af439cf..055ff4297b7f37 100644 --- a/devtools/cli/src/main/resources/application.properties +++ b/devtools/cli/src/main/resources/application.properties @@ -1,6 +1,6 @@ quarkus.log.level=WARN quarkus.banner.enabled=false -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar quarkus.native.resources.includes=quarkus.properties quarkus.native.additional-build-args=--initialize-at-run-time=org.apache.maven.wagon.shared.http.AbstractHttpClientWagon,\ -H:ReflectionConfigurationFiles=reflection-config.json 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 465fe8d7c1b13a..0c235c009f00fe 100644 --- a/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java +++ b/devtools/cli/src/test/java/io/quarkus/cli/CliProjectGradleTest.java @@ -259,8 +259,8 @@ public void testBuildOptions() throws Exception { Assertions.assertFalse(result.stdout.contains("-x test"), "gradle command should not specify '-x test'\n" + result); - Assertions.assertTrue(result.stdout.contains("-Dquarkus.package.type=native"), - "gradle command should specify -Dquarkus.package.type=native\n" + result); + Assertions.assertTrue(result.stdout.contains("-Dquarkus.native.enabled=true"), + "gradle command should specify -Dquarkus.native.enabled=true\n" + result); Assertions.assertTrue(result.stdout.contains("--offline"), "gradle command should specify --offline\n" + result); diff --git a/devtools/cli/src/test/java/io/quarkus/cli/image/CliImageGradleTest.java b/devtools/cli/src/test/java/io/quarkus/cli/image/CliImageGradleTest.java index aef3aab2e635bf..28787b5d7ddadc 100644 --- a/devtools/cli/src/test/java/io/quarkus/cli/image/CliImageGradleTest.java +++ b/devtools/cli/src/test/java/io/quarkus/cli/image/CliImageGradleTest.java @@ -95,10 +95,10 @@ public void testUsage() throws Exception { // 1 image --dry-run result = CliDriver.execute(project, "image", "--dry-run"); assertEquals(CommandLine.ExitCode.OK, result.getExitCode(), "Expected OK return code." + result); - assertFalse(result.getStdout().contains("-Dquarkus.package.type=native")); + assertFalse(result.getStdout().contains("-Dquarkus.native.enabled=true")); result = CliDriver.execute(project, "image", "--native", "--dry-run"); assertEquals(CommandLine.ExitCode.OK, result.getExitCode(), "Expected OK return code." + result); - assertTrue(result.getStdout().contains("-Dquarkus.package.type=native")); + assertTrue(result.getStdout().contains("-Dquarkus.native.enabled=true")); // 2 image build --dry-run result = CliDriver.execute(project, "image", "build", "--dry-run"); @@ -132,7 +132,7 @@ public void testUsage() throws Exception { assertTrue(result.getStdout().contains("-Dquarkus.container-image.group=mygroup")); assertTrue(result.getStdout().contains("-Dquarkus.container-image.name=myname")); assertTrue(result.getStdout().contains("-Dquarkus.container-image.tag=1.0")); - assertTrue(result.getStdout().contains("-Dquarkus.package.type=native")); + assertTrue(result.getStdout().contains("-Dquarkus.native.enabled=true")); // 3 image push --dry-run result = CliDriver.execute(project, "image", "push", "--dry-run"); diff --git a/devtools/gradle/build-logic/src/main/kotlin/io.quarkus.devtools.java-library.gradle.kts b/devtools/gradle/build-logic/src/main/kotlin/io.quarkus.devtools.java-library.gradle.kts index 5ad88d8e2ade32..6132fe7ee12cc8 100644 --- a/devtools/gradle/build-logic/src/main/kotlin/io.quarkus.devtools.java-library.gradle.kts +++ b/devtools/gradle/build-logic/src/main/kotlin/io.quarkus.devtools.java-library.gradle.kts @@ -23,7 +23,7 @@ dependencies { } tasks.withType().configureEach { - options.release.set(11) + options.release.set(17) options.encoding = "UTF-8" } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java index 942515adbefc8f..49ba9b780cc009 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java @@ -70,6 +70,7 @@ public class QuarkusPlugin implements Plugin { public static final String ID = "io.quarkus"; public static final String DEFAULT_OUTPUT_DIRECTORY = "quarkus-app"; + @Deprecated public static final String QUARKUS_PACKAGE_TYPE = "quarkus.package.type"; // constant left here to not break potential users public static final String EXTENSION_NAME = "quarkus"; @@ -244,7 +245,7 @@ public boolean isSatisfiedBy(Task t) { tasks.register(BUILD_NATIVE_TASK_NAME, DefaultTask.class, task -> { task.finalizedBy(quarkusBuild); task.doFirst(t -> t.getLogger() - .warn("The 'buildNative' task has been deprecated in favor of 'build -Dquarkus.package.type=native'")); + .warn("The 'buildNative' task has been deprecated in favor of 'build -Dquarkus.native.enabled=true'")); }); configureBuildNativeTask(project); @@ -482,11 +483,11 @@ private void configureBuildNativeTask(Project project) { || taskGraph.hasTask(project.getPath() + TEST_NATIVE_TASK_NAME)) { // Nag user project.getLogger().warn("The Quarkus tasks {} and {} are deprecated and subject to removal. " + - "Please migrate your build to use 'test -Dquarkus.package.type=native' and " + - "'quarkusBuild -Dquarkus.package.type=native'.", + "Please migrate your build to use 'test -Dquarkus.native.enabled=true' and " + + "'quarkusBuild -Dquarkus.native.enabeld=true'.", TEST_NATIVE_TASK_NAME, BUILD_NATIVE_TASK_NAME); project.getExtensions().getExtraProperties() - .set(QUARKUS_PACKAGE_TYPE, "native"); + .set("quarkus.native.enabled", "true"); } }); } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/AbstractQuarkusExtension.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/AbstractQuarkusExtension.java index 85f67e430dfc16..e44d48210e36df 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/AbstractQuarkusExtension.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/AbstractQuarkusExtension.java @@ -36,8 +36,8 @@ * package and to the {@link io.quarkus.gradle.extension.QuarkusPluginExtension} class itself. */ public abstract class AbstractQuarkusExtension { - private static final String MANIFEST_SECTIONS_PROPERTY_PREFIX = "quarkus.package.manifest.manifest-sections"; - private static final String MANIFEST_ATTRIBUTES_PROPERTY_PREFIX = "quarkus.package.manifest.attributes"; + private static final String MANIFEST_SECTIONS_PROPERTY_PREFIX = "quarkus.package.jar.manifest.manifest-sections"; + private static final String MANIFEST_ATTRIBUTES_PROPERTY_PREFIX = "quarkus.package.jar.manifest.attributes"; private static final String QUARKUS_PROFILE = "quarkus.profile"; protected final Project project; @@ -59,10 +59,11 @@ protected AbstractQuarkusExtension(Project project) { this.finalName.convention(project.provider(() -> String.format("%s-%s", project.getName(), project.getVersion()))); this.forcedPropertiesProperty = project.getObjects().mapProperty(String.class, String.class); this.quarkusBuildProperties = project.getObjects().mapProperty(String.class, String.class); - this.cachingRelevantProperties = project.getObjects().listProperty(String.class).value(List.of("quarkus[.].*")); + this.cachingRelevantProperties = project.getObjects().listProperty(String.class) + .value(List.of("quarkus[.].*", "platform[.]quarkus[.].*")); this.ignoredEntries = project.getObjects().listProperty(String.class); this.ignoredEntries.convention( - project.provider(() -> baseConfig().packageConfig().userConfiguredIgnoredEntries.orElse(emptyList()))); + project.provider(() -> baseConfig().packageConfig().jar().userConfiguredIgnoredEntries().orElse(emptyList()))); this.baseConfig = project.getObjects().property(BaseConfig.class).value(project.provider(this::buildBaseConfig)); SourceSet mainSourceSet = getSourceSet(project, SourceSet.MAIN_SOURCE_SET_NAME); this.classpath = dependencyClasspath(mainSourceSet); @@ -106,9 +107,8 @@ protected EffectiveConfig buildEffectiveConfiguration(ResolvedDependency appArti String userIgnoredEntries = String.join(",", ignoredEntries.get()); if (!userIgnoredEntries.isEmpty()) { - properties.put("quarkus.package.user-configured-ignored-entries", userIgnoredEntries); + properties.put("quarkus.package.jar.user-configured-ignored-entries", userIgnoredEntries); } - properties.putIfAbsent("quarkus.application.name", appArtifact.getArtifactId()); properties.putIfAbsent("quarkus.application.version", appArtifact.getVersion()); @@ -150,17 +150,18 @@ protected Map buildSystemProperties(ResolvedDependency appArtifa buildSystemProperties.putIfAbsent("quarkus.application.version", appArtifact.getVersion()); for (Map.Entry entry : forcedPropertiesProperty.get().entrySet()) { - if (entry.getKey().startsWith("quarkus.")) { + if (entry.getKey().startsWith("quarkus.") || entry.getKey().startsWith("platform.quarkus.")) { buildSystemProperties.put(entry.getKey(), entry.getValue()); } } for (Map.Entry entry : quarkusBuildProperties.get().entrySet()) { - if (entry.getKey().startsWith("quarkus.")) { + if (entry.getKey().startsWith("quarkus.") || entry.getKey().startsWith("platform.quarkus.")) { buildSystemProperties.put(entry.getKey(), entry.getValue()); } } for (Map.Entry entry : project.getProperties().entrySet()) { - if (entry.getKey().startsWith("quarkus.") && entry.getValue() != null) { + if ((entry.getKey().startsWith("quarkus.") || entry.getKey().startsWith("platform.quarkus.")) + && entry.getValue() != null) { buildSystemProperties.put(entry.getKey(), entry.getValue().toString()); } } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/BaseConfig.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/BaseConfig.java index 5e0d9533e92dcf..5ea1afc05997c5 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/BaseConfig.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/BaseConfig.java @@ -6,9 +6,9 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; +import io.quarkus.deployment.pkg.NativeConfig; import io.quarkus.deployment.pkg.PackageConfig; import io.quarkus.gradle.dsl.Manifest; -import io.quarkus.runtime.configuration.ConfigInstantiator; /** * Required parts of the configuration used to configure a Quarkus build task, does not contain settings @@ -21,18 +21,19 @@ final class BaseConfig { private final Manifest manifest; private final PackageConfig packageConfig; + private final NativeConfig nativeConfig; private final Map values; // Note: EffectiveConfig has all the code to load the configurations from all the sources. BaseConfig(EffectiveConfig config) { manifest = new Manifest(); - packageConfig = new PackageConfig(); - - ConfigInstantiator.handleObject(packageConfig, config.getConfig()); + packageConfig = config.getConfig().getConfigMapping(PackageConfig.class); + nativeConfig = config.getConfig().getConfigMapping(NativeConfig.class); // populate the Gradle Manifest object - manifest.attributes(packageConfig.manifest.attributes); - packageConfig.manifest.manifestSections.forEach((section, attribs) -> manifest.attributes(attribs, section)); + PackageConfig.JarConfig.ManifestConfig manifestConfig = packageConfig.jar().manifest(); + manifest.attributes(manifestConfig.attributes()); + manifestConfig.sections().forEach((section, attribs) -> manifest.attributes(attribs, section)); values = config.getValues(); } @@ -41,8 +42,12 @@ PackageConfig packageConfig() { return packageConfig; } - PackageConfig.BuiltInType packageType() { - return PackageConfig.BuiltInType.fromString(packageConfig.type); + NativeConfig nativeConfig() { + return nativeConfig; + } + + PackageConfig.JarConfig.JarType jarType() { + return packageConfig().jar().type(); } Manifest manifest() { diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java index 1c67c52ac46379..e05ef9ed6d5860 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java @@ -22,6 +22,8 @@ import com.google.common.annotations.VisibleForTesting; import io.quarkus.deployment.configuration.ClassLoadingConfig; +import io.quarkus.deployment.configuration.ConfigCompatibility; +import io.quarkus.deployment.pkg.NativeConfig; import io.quarkus.deployment.pkg.PackageConfig; import io.quarkus.runtime.configuration.ApplicationPropertiesConfigSourceLoader; import io.quarkus.runtime.configuration.ConfigUtils; @@ -63,6 +65,7 @@ private EffectiveConfig(Builder builder) { // 255 -> application,(yaml|yml) (in classpath/source) // 250 -> application.properties (in classpath/source) // 100 -> microprofile.properties (in classpath/source) + // 0 -> fallback config source for error workaround (see below) configSources.add(new PropertiesConfigSource(builder.forcedProperties, "forcedProperties", 600)); configSources.add(new PropertiesConfigSource(asStringMap(builder.taskProperties), "taskProperties", 500)); @@ -81,6 +84,10 @@ private EffectiveConfig(Builder builder) { configSources .addAll(PropertiesConfigSourceProvider.classPathSources(META_INF_MICROPROFILE_CONFIG_PROPERTIES, classLoader)); + // todo: this is due to ApplicationModel#getPlatformProperties not being included in the effective config + configSources.add(new PropertiesConfigSource(Map.of("platform.quarkus.native.builder-image", "<>"), + "NativeConfig#builderImage", 0)); + this.config = buildConfig(builder.profile, configSources); this.values = generateFullConfigMap(config); } @@ -129,6 +136,9 @@ static SmallRyeConfig buildConfig(String profile, List configSourc .setAddDefaultSources(false) .withSources(configSources) .withProfile(profile) + .withMapping(PackageConfig.class) + .withMapping(NativeConfig.class) + .withInterceptors(ConfigCompatibility.FrontEnd.instance(), ConfigCompatibility.BackEnd.instance()) .build(); } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java index a2dcbb502b1b4d..a96250c9258547 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java @@ -101,93 +101,100 @@ public File getArtifactProperties() { return artifactProperties(); } + @SuppressWarnings("deprecation") // legacy JAR @OutputDirectories protected Map getBuildOutputDirectories() { Map outputs = new HashMap<>(); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case LEGACY_JAR: - case LEGACY: - outputs.put("fast-jar", fastJar()); - outputs.put("legacy-lib", gradleBuildDir().resolve("lib").toFile()); - break; - case NATIVE: - outputs.put("native-source", nativeSources()); - outputs.put("fast-jar", fastJar()); - break; - case JAR: - case FAST_JAR: - outputs.put("fast-jar", fastJar()); - break; - case MUTABLE_JAR: - case UBER_JAR: - outputs.put("fast-jar", fastJar()); - outputs.put("generated", genBuildDir().toFile()); - break; - case NATIVE_SOURCES: + if (nativeEnabled()) { + if (jarEnabled()) { + throw nativeAndJar(); + } + if (nativeSourcesOnly()) { outputs.put("fast-jar", fastJar()); outputs.put("generated", genBuildDir().toFile()); outputs.put("native-source", nativeSources()); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } else { + outputs.put("native-source", nativeSources()); + outputs.put("fast-jar", fastJar()); + } + } else if (jarEnabled()) { + PackageConfig.JarConfig.JarType jarType = jarType(); + switch (jarType) { + case LEGACY_JAR -> { + outputs.put("fast-jar", fastJar()); + outputs.put("legacy-lib", gradleBuildDir().resolve("lib").toFile()); + } + case FAST_JAR -> outputs.put("fast-jar", fastJar()); + case MUTABLE_JAR, UBER_JAR -> { + outputs.put("fast-jar", fastJar()); + outputs.put("generated", genBuildDir().toFile()); + } + } } return outputs; } + @SuppressWarnings("deprecation") // legacy JAR @OutputFiles protected Map getBuildOutputFiles() { Map outputs = new HashMap<>(); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case UBER_JAR: - case LEGACY_JAR: - case LEGACY: - outputs.put("runner-jar", runnerJar()); + if (nativeEnabled()) { + if (jarEnabled()) { + throw nativeAndJar(); + } + if (nativeSourcesOnly()) { outputs.put("artifact-properties", artifactProperties()); - break; - case NATIVE: + } else { outputs.put("native-runner", nativeRunner()); outputs.put("artifact-properties", artifactProperties()); - break; - case JAR: - case FAST_JAR: - case MUTABLE_JAR: - case NATIVE_SOURCES: - outputs.put("artifact-properties", artifactProperties()); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } + } else if (jarEnabled()) { + PackageConfig.JarConfig.JarType packageType = jarType(); + switch (packageType) { + case UBER_JAR, LEGACY_JAR -> { + outputs.put("runner-jar", runnerJar()); + outputs.put("artifact-properties", artifactProperties()); + } + case FAST_JAR, MUTABLE_JAR -> outputs.put("artifact-properties", artifactProperties()); + } } return outputs; } + @SuppressWarnings("deprecation") // legacy JAR @InputFiles @PathSensitive(PathSensitivity.RELATIVE) protected Collection getBuildInputFiles() { List inputs = new ArrayList<>(); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: + if (nativeEnabled()) { + if (jarEnabled()) { + throw nativeAndJar(); + } + if (nativeSourcesOnly()) { + // nothing + } else { Path appBuildBaseDir = appBuildDir(); inputs.add(genBuildDir().toFile()); inputs.add(appBuildBaseDir.resolve(outputDirectory()).toFile()); runnerAndArtifactsInputs(inputs::add, appBuildBaseDir); - break; - case LEGACY_JAR: - case LEGACY: - inputs.add(depBuildDir().resolve("lib").toFile()); - inputs.add(appBuildDir().resolve("lib").toFile()); - runnerAndArtifactsInputs(inputs::add, appBuildDir()); - break; - case MUTABLE_JAR: - case NATIVE_SOURCES: - case UBER_JAR: - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } + } else if (jarEnabled()) { + PackageConfig.JarConfig.JarType packageType = jarType(); + switch (packageType) { + case FAST_JAR -> { + Path appBuildBaseDir = appBuildDir(); + inputs.add(genBuildDir().toFile()); + inputs.add(appBuildBaseDir.resolve(outputDirectory()).toFile()); + runnerAndArtifactsInputs(inputs::add, appBuildBaseDir); + } + case LEGACY_JAR -> { + inputs.add(depBuildDir().resolve("lib").toFile()); + inputs.add(appBuildDir().resolve("lib").toFile()); + runnerAndArtifactsInputs(inputs::add, appBuildDir()); + } + case MUTABLE_JAR, UBER_JAR -> { + } + } } return inputs; } @@ -200,6 +207,7 @@ private void runnerAndArtifactsInputs(Consumer buildInputs, Path sourceDir buildInputs.accept(sourceDir.resolve(nativeImageSourceJarDirName()).toFile()); } + @SuppressWarnings("deprecation") // legacy JAR @TaskAction public void finalizeQuarkusBuild() { if (extension().forcedPropertiesProperty().get().containsKey(QUARKUS_IGNORE_LEGACY_DEPLOY_BUILD)) { @@ -211,30 +219,31 @@ public void finalizeQuarkusBuild() { getLogger().info("Removing output files and directories (provide a clean state)."); getFileSystemOperations().delete(delete -> delete.delete(getBuildOutputFiles().values())); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: - assembleFastJar(); - break; - case LEGACY_JAR: - case LEGACY: - assembleLegacyJar(); - break; - case MUTABLE_JAR: - case UBER_JAR: - case NATIVE_SOURCES: + if (nativeEnabled()) { + if (jarEnabled()) { + throw nativeAndJar(); + } + if (nativeSourcesOnly()) { generateBuild(); assembleFullBuild(); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } else { + assembleFastJar(); + } + } else if (jarEnabled()) { + PackageConfig.JarConfig.JarType jarType = jarType(); + switch (jarType) { + case FAST_JAR -> assembleFastJar(); + case LEGACY_JAR -> assembleLegacyJar(); + case MUTABLE_JAR, UBER_JAR -> { + generateBuild(); + assembleFullBuild(); + } + } } } private void assembleLegacyJar() { - getLogger().info("Finalizing Quarkus build for {} packaging", packageType()); + getLogger().info("Finalizing Quarkus build for {} JAR type", jarType()); Path buildDir = this.buildDir.toPath(); Path libDir = buildDir.resolve("lib"); @@ -285,8 +294,17 @@ private void assembleFullBuild() { // build/quarkus-build/gen Path genBuildDir = genBuildDir(); - getLogger().info("Copying Quarkus build for {} packaging from {} into {}", packageType(), - genBuildDir, targetDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Copying Quarkus build for native sources from {} into {}", genBuildDir, targetDir); + } else { + getLogger().info("Copying Quarkus native build from {} into {}", genBuildDir, targetDir); + + } + } else { + getLogger().info("Copying Quarkus build for {} JAR type from {} into {}", jarType(), + genBuildDir, targetDir); + } getFileSystemOperations().copy(copy -> { copy.into(targetDir); copy.from(genBuildDir); @@ -305,8 +323,18 @@ private void assembleFastJar() { // build/quarkus-build/dep Path depBuildDir = depBuildDir(); - getLogger().info("Synchronizing Quarkus build for {} packaging from {} and {} into {}", packageType(), - appBuildDir, depBuildDir, appTargetDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Synchronizing Quarkus build for native sources from {} and {} into {}", + appBuildDir, depBuildDir, appTargetDir); + } else { + getLogger().info("Synchronizing Quarkus native build from {} and {} into {}", + appBuildDir, depBuildDir, appTargetDir); + } + } else { + getLogger().info("Synchronizing Quarkus build for {} JAR type from {} and {} into {}", jarType(), + appBuildDir, depBuildDir, appTargetDir); + } getFileSystemOperations().sync(sync -> { sync.eachFile(new CopyActionDeleteNonWriteableTarget(appTargetDir.toPath())); sync.into(appTargetDir); @@ -317,8 +345,18 @@ private void assembleFastJar() { } private void copyRunnersAndArtifactProperties(Path sourceDir) { - getLogger().info("Copying remaining Quarkus application artifacts for {} packaging from {} into {}", - packageType(), sourceDir, buildDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Copying remaining Quarkus application artifacts for native sources from {} into {}", + sourceDir, buildDir); + } else { + getLogger().info("Copying remaining Quarkus application artifacts for native build from {} into {}", + sourceDir, buildDir); + } + } else { + getLogger().info("Copying remaining Quarkus application artifacts for {} JAR type from {} into {}", + jarType(), sourceDir, buildDir); + } getFileSystemOperations().copy( copy -> copy.into(buildDir).from(sourceDir) .include(QUARKUS_ARTIFACT_PROPERTIES, @@ -336,4 +374,9 @@ private String expandConfigurationKey(String shortKey) { } return String.format("%s.%s", NATIVE_PROPERTY_NAMESPACE, hyphenatedKey); } + + static GradleException nativeAndJar() { + return new GradleException("Outputting both native and JAR packages is not currently supported"); + } + } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildCacheableAppParts.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildCacheableAppParts.java index 7bccd1ff03ec65..bff10d3a669e00 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildCacheableAppParts.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildCacheableAppParts.java @@ -7,7 +7,6 @@ import javax.inject.Inject; -import org.gradle.api.GradleException; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.OutputDirectories; @@ -26,45 +25,44 @@ public QuarkusBuildCacheableAppParts() { " Do not use this task directly, use '" + QuarkusPlugin.QUARKUS_BUILD_TASK_NAME + "'"); } + @SuppressWarnings("deprecation") // legacy JAR @Internal public boolean isCachedByDefault() { - switch (packageType()) { - case JAR: - case FAST_JAR: - case LEGACY_JAR: - case LEGACY: - return true; - default: - return false; + if (nativeEnabled()) { + return false; } + return switch (jarType()) { + case FAST_JAR, LEGACY_JAR -> true; + default -> false; + }; } /** * Points to {@code build/quarkus-build/app} and includes the uber-jar, native runner and "quarkus-app" directory * w/o the `lib/` folder. */ + @SuppressWarnings("deprecation") // legacy JAR @OutputDirectories public Map getOutputDirectories() { Map outputs = new HashMap<>(); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: - case LEGACY_JAR: - case LEGACY: + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + // nothing + } else { outputs.put("app-build-dir", appBuildDir().toFile()); - break; - case MUTABLE_JAR: - case UBER_JAR: - case NATIVE_SOURCES: - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } + } else { + PackageConfig.JarConfig.JarType jarType = jarType(); + switch (jarType) { + case FAST_JAR, LEGACY_JAR -> outputs.put("app-build-dir", appBuildDir().toFile()); + case MUTABLE_JAR, UBER_JAR -> { + } + } } return outputs; } + @SuppressWarnings("deprecation") // legacy JAR @TaskAction public void performQuarkusBuild() { Path appDir = appBuildDir(); @@ -73,26 +71,22 @@ public void performQuarkusBuild() { // checks work against "clean" outputs, considering that the outputs depend on the package-type. getFileSystemOperations().delete(delete -> delete.delete(appDir)); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: - fastJarBuild(); - break; - case LEGACY_JAR: - case LEGACY: - legacyJarBuild(); - break; - case MUTABLE_JAR: - case UBER_JAR: - case NATIVE_SOURCES: + if (nativeEnabled()) { + if (nativeSourcesOnly()) { getLogger().info( - "Falling back to 'full quarkus application build' for package type {}, this task's output is empty for this package type", - packageType); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + "Falling back to 'full quarkus application build' for native sources, this task's output is empty for this package type"); + } else { + fastJarBuild(); + } + } else { + PackageConfig.JarConfig.JarType jarType = jarType(); + switch (jarType) { + case FAST_JAR -> fastJarBuild(); + case LEGACY_JAR -> legacyJarBuild(); + case MUTABLE_JAR, UBER_JAR -> getLogger().info( + "Falling back to 'full quarkus application build' for JAR type {}, this task's output is empty for this package type", + jarType); + } } } @@ -102,7 +96,7 @@ private void legacyJarBuild() { Path genDir = genBuildDir(); Path appDir = appBuildDir(); - getLogger().info("Synchronizing Quarkus legacy-jar app for package type {} into {}", packageType(), + getLogger().info("Synchronizing Quarkus legacy-jar app for JAR type {} into {}", jarType(), appDir); getFileSystemOperations().sync(sync -> { @@ -125,8 +119,18 @@ private void fastJarBuild() { Path genDir = genBuildDir(); Path appDir = appBuildDir(); - getLogger().info("Synchronizing Quarkus fast-jar-like app for package type {} into {}", packageType(), - appDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Synchronizing Quarkus fast-jar-like app for native sources into {}", + appDir); + } else { + getLogger().info("Synchronizing Quarkus fast-jar-like app for native into {}", + appDir); + } + } else { + getLogger().info("Synchronizing Quarkus fast-jar-like app for JAR type {} into {}", jarType(), + appDir); + } getFileSystemOperations().sync(sync -> { sync.into(appDir); diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java index d18dd3c70636f7..a2b3a9d743af65 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java @@ -37,7 +37,7 @@ public abstract class QuarkusBuildDependencies extends QuarkusBuildTask { static final String CLASS_LOADING_REMOVED_ARTIFACTS = "quarkus.class-loading.removed-artifacts"; static final String CLASS_LOADING_PARENT_FIRST_ARTIFACTS = "quarkus.class-loading.parent-first-artifacts"; static final String FILTER_OPTIONAL_DEPENDENCIES = "quarkus.package.filter-optional-dependencies"; - static final String INCLUDED_OPTIONAL_DEPENDENCIES = "quarkus.package.included-optional-dependencies"; + static final String INCLUDED_OPTIONAL_DEPENDENCIES = "quarkus.package.jar.included-optional-dependencies"; @Inject public QuarkusBuildDependencies() { @@ -48,28 +48,28 @@ public QuarkusBuildDependencies() { /** * Points to {@code build/quarkus-build/dep}. */ + @SuppressWarnings("deprecation") // legacy JAR @OutputDirectories public Map getOutputDirectories() { Map outputs = new HashMap<>(); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: - case LEGACY_JAR: - case LEGACY: + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + // nothing + } else { outputs.put("dependencies-dir", depBuildDir().toFile()); - break; - case MUTABLE_JAR: - case UBER_JAR: - case NATIVE_SOURCES: - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } + } else { + PackageConfig.JarConfig.JarType packageType = jarType(); + switch (packageType) { + case FAST_JAR, LEGACY_JAR -> outputs.put("dependencies-dir", depBuildDir().toFile()); + case MUTABLE_JAR, UBER_JAR -> { + } + } } return outputs; } + @SuppressWarnings("deprecation") // legacy JAR @TaskAction public void collectDependencies() { Path depDir = depBuildDir(); @@ -78,26 +78,22 @@ public void collectDependencies() { // checks work against "clean" outputs, considering that the outputs depend on the package-type. getFileSystemOperations().delete(delete -> delete.delete(depDir)); - PackageConfig.BuiltInType packageType = packageType(); - switch (packageType) { - case JAR: - case FAST_JAR: - case NATIVE: - fastJarDependencies(); - break; - case LEGACY_JAR: - case LEGACY: - legacyJarDependencies(); - break; - case MUTABLE_JAR: - case UBER_JAR: - case NATIVE_SOURCES: + if (nativeEnabled()) { + if (nativeSourcesOnly()) { getLogger().info( - "Falling back to 'full quarkus application build' for package type {}, this task's output is empty for this package type", + "Falling back to 'full quarkus application build' for native sources, this task's output is empty for this build type"); + } else { + fastJarDependencies(); + } + } else { + PackageConfig.JarConfig.JarType packageType = jarType(); + switch (packageType) { + case FAST_JAR -> fastJarDependencies(); + case LEGACY_JAR -> legacyJarDependencies(); + case MUTABLE_JAR, UBER_JAR -> getLogger().info( + "Falling back to 'full quarkus application build' for JAR type {}, this task's output is empty for this build type", packageType); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } } } @@ -129,8 +125,16 @@ private void legacyJarDependencies() { private void jarDependencies(Path libBoot, Path libMain) { Path depDir = depBuildDir(); - getLogger().info("Placing Quarkus application dependencies for package type {} in {}", packageType(), - depDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Placing Quarkus application dependencies for native sources build in {}", depDir); + } else { + getLogger().info("Placing Quarkus application dependencies for native build in {}", depDir); + } + } else { + getLogger().info("Placing Quarkus application dependencies for JAR type {} in {}", jarType(), + depDir); + } try { Files.createDirectories(libBoot); diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildTask.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildTask.java index 827ace86ae8458..4c91244ec9f6fc 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildTask.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildTask.java @@ -65,8 +65,20 @@ public Map getCachingRelevantInput() { return extension().baseConfig().cachingRelevantProperties(vars.get()); } - PackageConfig.BuiltInType packageType() { - return extension().baseConfig().packageType(); + PackageConfig.JarConfig.JarType jarType() { + return extension().baseConfig().jarType(); + } + + boolean jarEnabled() { + return extension().baseConfig().packageConfig().jar().enabled(); + } + + boolean nativeEnabled() { + return extension().baseConfig().nativeConfig().enabled(); + } + + boolean nativeSourcesOnly() { + return extension().baseConfig().nativeConfig().sourcesOnly(); } Path gradleBuildDir() { @@ -132,17 +144,17 @@ String nativeImageSourceJarDirName() { String runnerBaseName() { BaseConfig baseConfig = extension().baseConfig(); - return baseConfig.packageConfig().outputName.orElseGet(() -> extension().finalName()); + return baseConfig.packageConfig().outputName().orElseGet(() -> extension().finalName()); } String outputDirectory() { BaseConfig baseConfig = extension().baseConfig(); - return baseConfig.packageConfig().outputDirectory.orElse(QuarkusPlugin.DEFAULT_OUTPUT_DIRECTORY); + return baseConfig.packageConfig().outputDirectory().map(Path::toString).orElse(QuarkusPlugin.DEFAULT_OUTPUT_DIRECTORY); } private String runnerSuffix() { BaseConfig baseConfig = extension().baseConfig(); - return baseConfig.packageConfig().getRunnerSuffix(); + return baseConfig.packageConfig().computedRunnerSuffix(); } ApplicationModel resolveAppModelForBuild() { @@ -171,11 +183,19 @@ ApplicationModel resolveAppModelForBuild() { *

  • populate the * */ + @SuppressWarnings("deprecation") // legacy JAR void generateBuild() { Path buildDir = gradleBuildDir(); Path genDir = genBuildDir(); - PackageConfig.BuiltInType packageType = packageType(); - getLogger().info("Building Quarkus app for package type {} in {}", packageType, genDir); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Building Quarkus app for native (sources only) packaging in {}", genDir); + } else { + getLogger().info("Building Quarkus app for native packaging in {}", genDir); + } + } else { + getLogger().info("Building Quarkus app for JAR type {} in {}", jarType(), genDir); + } // Need to delete app-cds.jsa specially, because it's usually read-only and Gradle's delete file-system // operation doesn't delete "read only" files :( @@ -186,24 +206,21 @@ void generateBuild() { delete.delete(genDir); // Delete directories inside Gradle's build/ dir that are going to be populated by the Quarkus build. - switch (packageType) { - case JAR: - case FAST_JAR: - delete.delete(buildDir.resolve(nativeImageSourceJarDirName())); - // fall through - case NATIVE: - case NATIVE_SOURCES: - delete.delete(fastJar()); - break; - case LEGACY_JAR: - case LEGACY: - delete.delete(buildDir.resolve("lib")); - break; - case MUTABLE_JAR: - case UBER_JAR: - break; - default: - throw new GradleException("Unsupported package type " + packageType); + if (nativeEnabled()) { + if (jarEnabled()) { + throw QuarkusBuild.nativeAndJar(); + } + delete.delete(fastJar()); + } else if (jarEnabled()) { + switch (jarType()) { + case FAST_JAR -> { + delete.delete(buildDir.resolve(nativeImageSourceJarDirName())); + delete.delete(fastJar()); + } + case LEGACY_JAR -> delete.delete(buildDir.resolve("lib")); + case MUTABLE_JAR, UBER_JAR -> { + } + } } }); @@ -216,7 +233,15 @@ void generateBuild() { return values; }); - getLogger().info("Starting Quarkus application build for package type {}", packageType); + if (nativeEnabled()) { + if (nativeSourcesOnly()) { + getLogger().info("Starting Quarkus application build for native (sources only) packaging"); + } else { + getLogger().info("Starting Quarkus application build for native packaging"); + } + } else { + getLogger().info("Starting Quarkus application build for JAR type {}", jarType()); + } if (getLogger().isEnabled(LogLevel.INFO)) { getLogger().info("Effective properties: {}", @@ -244,31 +269,35 @@ void generateBuild() { copy.from(buildDir); copy.into(genDir); copy.eachFile(new CopyActionDeleteNonWriteableTarget(genDir)); - switch (packageType) { - case NATIVE: + if (nativeEnabled()) { + if (jarEnabled()) { + throw QuarkusBuild.nativeAndJar(); + } + if (nativeSourcesOnly()) { + copy.include(QUARKUS_ARTIFACT_PROPERTIES); + copy.include(nativeImageSourceJarDirName() + "/**"); + } else { copy.include(nativeRunnerFileName()); copy.include(nativeImageSourceJarDirName() + "/**"); - // fall through - case JAR: - case FAST_JAR: copy.include(outputDirectory() + "/**"); copy.include(QUARKUS_ARTIFACT_PROPERTIES); - break; - case LEGACY_JAR: - case LEGACY: - copy.include("lib/**"); - // fall through - case MUTABLE_JAR: - case UBER_JAR: - copy.include(QUARKUS_ARTIFACT_PROPERTIES); - copy.include(runnerJarFileName()); - break; - case NATIVE_SOURCES: - copy.include(QUARKUS_ARTIFACT_PROPERTIES); - copy.include(nativeImageSourceJarDirName() + "/**"); - break; - default: - throw new GradleException("Unsupported package type " + packageType); + } + } else if (jarEnabled()) { + switch (jarType()) { + case FAST_JAR -> { + copy.include(outputDirectory() + "/**"); + copy.include(QUARKUS_ARTIFACT_PROPERTIES); + } + case LEGACY_JAR -> { + copy.include("lib/**"); + copy.include(QUARKUS_ARTIFACT_PROPERTIES); + copy.include(runnerJarFileName()); + } + case MUTABLE_JAR, UBER_JAR -> { + copy.include(QUARKUS_ARTIFACT_PROPERTIES); + copy.include(runnerJarFileName()); + } + } } }); } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusShowEffectiveConfig.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusShowEffectiveConfig.java index 2115ee6ee6ad64..caeb2993b6979b 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusShowEffectiveConfig.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusShowEffectiveConfig.java @@ -20,7 +20,6 @@ import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.options.Option; -import io.quarkus.gradle.QuarkusPlugin; import io.smallrye.config.SmallRyeConfig; /** @@ -59,17 +58,17 @@ public void dumpEffectiveConfiguration() { getLogger().lifecycle("Effective Quarkus configuration options: {}", quarkusConfig); String finalName = extension().finalName(); - String packageType = config.getOptionalValue(QuarkusPlugin.QUARKUS_PACKAGE_TYPE, String.class).orElse("fast-jar"); + String jarType = config.getOptionalValue("quarkus.package.jar.type", String.class).orElse("fast-jar"); File fastJar = fastJar(); getLogger().lifecycle( - "Quarkus package type: {}\n" + + "Quarkus JAR type: {}\n" + "Final name: {}\n" + "Output directory: {}\n" + "Fast jar directory (if built): {}\n" + "Runner jar (if built): {}\n" + "Native runner (if built): {}\n" + "application.(properties|yaml|yml) sources: {}", - packageType, + jarType, finalName, outputDirectory(), fastJar, @@ -82,7 +81,7 @@ public void dumpEffectiveConfiguration() { props.putAll(effectiveConfig.getValues()); Path file = buildDir.toPath().resolve(finalName + ".quarkus-build.properties"); try (BufferedWriter writer = newBufferedWriter(file)) { - props.store(writer, format("Quarkus build properties with package type %s", packageType)); + props.store(writer, format("Quarkus build properties with JAR type %s", jarType)); } catch (IOException e) { throw new GradleException("Failed to write Quarkus build configuration settings", e); } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/worker/BuildWorker.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/worker/BuildWorker.java index e49d90db1c4797..c8b0fd7494a493 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/worker/BuildWorker.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/worker/BuildWorker.java @@ -24,7 +24,6 @@ import io.quarkus.bootstrap.app.CuratedApplication; import io.quarkus.bootstrap.app.JarResult; import io.quarkus.devtools.messagewriter.MessageWriter; -import io.quarkus.gradle.QuarkusPlugin; import io.quarkus.maven.dependency.ResolvedDependency; public abstract class BuildWorker extends QuarkusWorker { @@ -40,7 +39,7 @@ public void execute() { LOGGER.info("Building Quarkus application {}", gav); LOGGER.info(" base name: {}", params.getBaseName().get()); LOGGER.info(" target directory: {}", params.getTargetDirectory().getAsFile().get()); - LOGGER.info(" configured package type: {}", props.getProperty(QuarkusPlugin.QUARKUS_PACKAGE_TYPE)); + LOGGER.info(" configured JAR type: {}", props.getProperty("quarkus.package.jar.type")); LOGGER.info(" configured output directory: {}", props.getProperty("quarkus.package.output-directory")); LOGGER.info(" configured output name: {}", props.getProperty("quarkus.package.output-name")); LOGGER.info(" Gradle version: {}", params.getGradleVersion().get()); diff --git a/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java b/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java index 74f976e2b4b7a7..c5ea6f9064234e 100644 --- a/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java +++ b/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/QuarkusPluginTest.java @@ -158,7 +158,7 @@ public void shouldNotFailOnProjectDependenciesWithoutMain(@TempDir Path testProj BuildResult result = GradleRunner.create() .withPluginClasspath() .withProjectDir(testProjectDir.toFile()) - .withArguments("quarkusGenerateCode") + .withArguments("quarkusGenerateCode", "--stacktrace") .build(); assertEquals(SUCCESS, result.task(":quarkus:quarkusGenerateCode").getOutcome()); diff --git a/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/tasks/CachingTest.java b/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/tasks/CachingTest.java index d1d27359e8215a..fa2a83db81fdc9 100644 --- a/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/tasks/CachingTest.java +++ b/devtools/gradle/gradle-application-plugin/src/test/java/io/quarkus/gradle/tasks/CachingTest.java @@ -77,7 +77,7 @@ void envChangeInvalidatesBuild() throws Exception { "cachingRelevantProperties.add(\"FROM_DOT_ENV_FILE\")")); String[] arguments = List.of("build", "--info", "--stacktrace", "--build-cache", "--configuration-cache", - "-Dquarkus.package.type=fast-jar", + "-Dquarkus.package.jar.type=fast-jar", "-Dquarkus.randomized.value=" + UUID.randomUUID()) .toArray(new String[0]); @@ -115,7 +115,7 @@ void dotEnvChangeInvalidatesBuild() throws Exception { "cachingRelevantProperties.add(\"FROM_DOT_ENV_FILE\")")); String[] arguments = List.of("build", "--info", "--stacktrace", "--build-cache", "--configuration-cache", - "-Dquarkus.package.type=fast-jar", + "-Dquarkus.package.jar.type=fast-jar", "-Dquarkus.randomized.value=" + UUID.randomUUID()) .toArray(new String[0]); @@ -170,10 +170,16 @@ void gradleCaching(String packageType, boolean simulateCI, String outputDir, @Te Map env = simulateCI ? Map.of("CI", "yes") : Map.of(); List args = new ArrayList<>(); - Collections.addAll(args, "build", "--info", "--stacktrace", "--build-cache", "--configuration-cache", - "-Dquarkus.package.type=" + packageType); + Collections.addAll(args, "build", "--info", "--stacktrace", "--build-cache", "--configuration-cache"); + if (packageType.equals("native-sources")) { + args.add("-Dquarkus.native.enabled=true"); + args.add("-Dquarkus.native.sources-only=true"); + args.add("-Dquarkus.package.jar.enabled=false"); + } else { + args.add("-Dquarkus.package.jar.type=" + packageType); + } if (outputDir != null) { - args.add("-Dquarkus.package.outputDirectory=" + outputDir); + args.add("-Dquarkus.package.output-directory=" + outputDir); } String[] arguments = args.toArray(new String[0]); diff --git a/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java index fefb7457970926..4018d44696c620 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java @@ -115,11 +115,8 @@ protected void doExecute() throws MojoExecutionException { } } - // Essentially what this does is to enable the native package type even if a different package type is set - // in application properties. This is done to preserve what users expect to happen when - // they execute "mvn package -Dnative" even if quarkus.package.type has been set in application.properties - if (setPackageTypeSystemPropertyIfNativeProfileEnabled()) { - propertiesToClear.add(PACKAGE_TYPE_PROP); + if (setNativeEnabledIfNativeProfileEnabled()) { + propertiesToClear.add("quarkus.native.enabled"); } if (!propertiesToClear.isEmpty() && mavenSession().getRequest().getDegreeOfConcurrency() > 1) { diff --git a/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapMojo.java index 4bbf1b902d4b40..364e455dc3e64e 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapMojo.java @@ -36,9 +36,7 @@ public abstract class QuarkusBootstrapMojo extends AbstractMojo { static final String CLOSE_BOOTSTRAPPED_APP = "closeBootstrappedApp"; - static final String NATIVE_PACKAGE_TYPE = "native"; static final String NATIVE_PROFILE_NAME = "native"; - static final String PACKAGE_TYPE_PROP = "quarkus.package.type"; @Component protected QuarkusBootstrapProvider bootstrapProvider; @@ -301,24 +299,17 @@ protected Properties getBuildSystemProperties(boolean quarkusOnly) throws MojoEx } /** - * Essentially what this does is to enable the native package type even if a different package type is set - * in application properties. This is done to preserve what users expect to happen when - * they execute "mvn package -Dnative" even if quarkus.package.type has been set in application.properties + * Cause the native-enabled flag to be set if the native profile is enabled. * * @return true if the package type system property was set, otherwise - false */ - protected boolean setPackageTypeSystemPropertyIfNativeProfileEnabled() { - if (!System.getProperties().containsKey(PACKAGE_TYPE_PROP) - && isNativeProfileEnabled(mavenProject())) { - Object packageTypeProp = mavenProject().getProperties().get(PACKAGE_TYPE_PROP); - String packageType = NATIVE_PACKAGE_TYPE; - if (packageTypeProp != null) { - packageType = packageTypeProp.toString(); - } - System.setProperty(PACKAGE_TYPE_PROP, packageType); + protected boolean setNativeEnabledIfNativeProfileEnabled() { + if (isNativeProfileEnabled(mavenProject())) { + System.setProperty("quarkus.native.enabled", "true"); return true; + } else { + return false; } - return false; } private boolean isNativeProfileEnabled(MavenProject mavenProject) { diff --git a/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java b/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java index 63f8e4aac717a9..e88a5d6af2623b 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java @@ -53,8 +53,8 @@ @Named public class QuarkusBootstrapProvider implements Closeable { - private static final String MANIFEST_SECTIONS_PROPERTY_PREFIX = "quarkus.package.manifest.manifest-sections"; - private static final String MANIFEST_ATTRIBUTES_PROPERTY_PREFIX = "quarkus.package.manifest.attributes"; + private static final String MANIFEST_SECTIONS_PROPERTY_PREFIX = "quarkus.package.jar,manifest.manifest-sections"; + private static final String MANIFEST_ATTRIBUTES_PROPERTY_PREFIX = "quarkus.package.jar.manifest.attributes"; private final QuarkusWorkspaceProvider workspaceProvider; private final RepositorySystem repoSystem; @@ -273,7 +273,7 @@ public Properties getBuildSystemProperties(QuarkusBootstrapMojo mojo, boolean qu // quarkus. properties > ignoredEntries in pom.xml if (mojo.ignoredEntries() != null && mojo.ignoredEntries().length > 0) { String joinedEntries = String.join(",", mojo.ignoredEntries()); - effectiveProperties.setProperty("quarkus.package.user-configured-ignored-entries", joinedEntries); + effectiveProperties.setProperty("quarkus.package.jar.user-configured-ignored-entries", joinedEntries); } final Properties projectProperties = mojo.mavenProject().getProperties(); diff --git a/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java index b023983db78b21..dc8f4193b6462e 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java @@ -121,7 +121,7 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException { CuratedApplication curatedApplication = null; QuarkusClassLoader deploymentClassLoader = null; final ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); - final boolean clearPackageTypeSystemProperty = setPackageTypeSystemPropertyIfNativeProfileEnabled(); + setNativeEnabledIfNativeProfileEnabled(); try { curatedApplication = bootstrapApplication(launchMode); if (prevConfigExists || dumpCurrentWhenRecordedUnavailable) { @@ -173,9 +173,6 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException { } catch (Exception any) { throw new MojoExecutionException("Failed to bootstrap Quarkus application", any); } finally { - if (clearPackageTypeSystemProperty) { - System.clearProperty(PACKAGE_TYPE_PROP); - } Thread.currentThread().setContextClassLoader(originalCl); if (deploymentClassLoader != null) { deploymentClassLoader.close(); diff --git a/docs/src/main/asciidoc/_includes/devtools/build-native-container-parameters.adoc b/docs/src/main/asciidoc/_includes/devtools/build-native-container-parameters.adoc index d30f1c353367fd..7320a9f26cceaf 100644 --- a/docs/src/main/asciidoc/_includes/devtools/build-native-container-parameters.adoc +++ b/docs/src/main/asciidoc/_includes/devtools/build-native-container-parameters.adoc @@ -16,6 +16,6 @@ ifdef::devtools-wrapped[+] [source,bash,subs=attributes+, role="secondary asciidoc-tabs-sync-gradle"] .Gradle ---- -./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true {build-additional-parameters} +./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true {build-additional-parameters} ---- endif::[] \ No newline at end of file diff --git a/docs/src/main/asciidoc/_includes/devtools/build-native-container.adoc b/docs/src/main/asciidoc/_includes/devtools/build-native-container.adoc index fa6ddc6b51e41e..b97733ac8fd750 100644 --- a/docs/src/main/asciidoc/_includes/devtools/build-native-container.adoc +++ b/docs/src/main/asciidoc/_includes/devtools/build-native-container.adoc @@ -28,10 +28,10 @@ ifdef::devtools-wrapped[+] .Gradle ---- ifdef::build-additional-parameters[] -./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true {build-additional-parameters} +./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true {build-additional-parameters} endif::[] ifndef::build-additional-parameters[] -./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true +./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true endif::[] ---- endif::[] \ No newline at end of file diff --git a/docs/src/main/asciidoc/_includes/devtools/build-native.adoc b/docs/src/main/asciidoc/_includes/devtools/build-native.adoc index 4312338484d46c..e7f78aa3705cc6 100644 --- a/docs/src/main/asciidoc/_includes/devtools/build-native.adoc +++ b/docs/src/main/asciidoc/_includes/devtools/build-native.adoc @@ -27,10 +27,10 @@ ifdef::devtools-wrapped[+] .Gradle ---- ifdef::build-additional-parameters[] -./gradlew build -Dquarkus.package.type=native {build-additional-parameters} +./gradlew build -Dquarkus.native.enabled=true {build-additional-parameters} endif::[] ifndef::build-additional-parameters[] -./gradlew build -Dquarkus.package.type=native +./gradlew build -Dquarkus.native.enabled=true endif::[] ---- endif::[] \ No newline at end of file diff --git a/docs/src/main/asciidoc/appcds.adoc b/docs/src/main/asciidoc/appcds.adoc index 59a82eaa0e8c5c..db08254f2cc414 100644 --- a/docs/src/main/asciidoc/appcds.adoc +++ b/docs/src/main/asciidoc/appcds.adoc @@ -30,12 +30,12 @@ This fact makes the use of AppCDS difficult to use for real world deployments wh === Creating the archive -Quarkus makes AppCDS generation as simple as setting the `quarkus.package.create-appcds` configuration property to `true`. +Quarkus makes AppCDS generation as simple as setting the `quarkus.package.jar.appcds.enabled` configuration property to `true`. For an example Quarkus application using Maven (assuming it is located in `/tmp/code-with-quarkus`), the AppCDS archive can be generated by simply building the application like so: [source,bash] ---- -./mvnw package -Dquarkus.package.create-appcds=true +./mvnw package -Dquarkus.package.jar.appcds.enabled=true ---- When the build completes, the output will contain (among other things) the following: @@ -98,4 +98,4 @@ AppCDS has improved significantly in the latest JDK releases. This means that to When building container images using the `quarkus-container-image-jib` extension, Quarkus automatically takes care of all the steps needed to generate the archive and make it usable at runtime in the container. -This way, by simply setting `quarkus.package.create-appcds` to `true` the generated container can benefit from a slight reduction in startup time and memory usage. +This way, by simply setting `quarkus.package.jar.appcds.enabled` to `true` the generated container can benefit from a slight reduction in startup time and memory usage. diff --git a/docs/src/main/asciidoc/building-native-image.adoc b/docs/src/main/asciidoc/building-native-image.adoc index 06019bc3fa1117..b408112f632976 100644 --- a/docs/src/main/asciidoc/building-native-image.adoc +++ b/docs/src/main/asciidoc/building-native-image.adoc @@ -178,7 +178,7 @@ If you have generated the application from the previous tutorial, you can find i native - native + true @@ -195,7 +195,7 @@ You can find more information about how to configure the native image building p ==== We use a profile because, you will see very soon, packaging the native executable takes a _few_ minutes. You could -just pass -Dquarkus.package.type=native as a property on the command line, however it is better to use a profile as +just pass -Dquarkus.native.enabled=true as a property on the command line, however it is better to use a profile as this allows native image tests to also be run. Create a native executable using: @@ -621,7 +621,7 @@ COPY --chown=quarkus:quarkus gradle.properties /code/ USER quarkus WORKDIR /code COPY src /code/src -RUN ./gradlew build -Dquarkus.package.type=native +RUN ./gradlew build -Dquarkus.native.enabled=true ## Stage 2 : create the docker final image FROM quay.io/quarkus/quarkus-micro-image:2.0 @@ -737,12 +737,12 @@ More details on xref:./upx.adoc[UPX Compression documentation]. In certain circumstances, you may want to build the native image in a separate step. For example, in a CI/CD pipeline, you may want to have one step to generate the source that will be used for the native image generation and another step to use these sources to actually build the native executable. -For this use case, you can set the `quarkus.package.type=native-sources`. +For this use case, you can set the additional flag `quarkus.native.sources-only=true`. This will execute the java compilation as if you had started native compilation (`-Dnative`), but stops before triggering the actual call to GraalVM's `native-image`. [source,bash] ---- -$ ./mvnw clean package -Dquarkus.package.type=native-sources +$ ./mvnw clean package -Dnative -Dquarkus.native.sources-only=true ---- After compilation has finished, you find the build artifact in `target/native-sources`: @@ -777,7 +777,7 @@ Running the build process in a container is also possible: [source,bash] ---- -$ ./mvnw clean package -Dquarkus.package.type=native-sources -Dquarkus.native.container-build=true +$ ./mvnw clean package -Dquarkus.native.enabled=true -Dquarkus.native.sources-only=true -Dquarkus.native.container-build=true ---- `-Dquarkus.native.container-build=true` will produce an additional text file named `native-builder.image` holding the docker image name to be used to build the native image. diff --git a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc index ba07f67a0a2efc..40cc488577a3a6 100644 --- a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc +++ b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc @@ -74,7 +74,7 @@ App Engine Standard does not support the default Quarkus' specific packaging lay [source, properties] ---- -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar ---- Then, you can choose to build the application manually or delegating that responsibility to `gcloud` or the Google Cloud Maven plugin. diff --git a/docs/src/main/asciidoc/gradle-tooling.adoc b/docs/src/main/asciidoc/gradle-tooling.adoc index c0c759a27f2e08..74b07fd79f8f57 100644 --- a/docs/src/main/asciidoc/gradle-tooling.adoc +++ b/docs/src/main/asciidoc/gradle-tooling.adoc @@ -275,7 +275,7 @@ To do this you must build a mutable application, using the `mutable-jar` format. [source,properties] ---- -quarkus.package.type=mutable-jar <1> +quarkus.package.jar.type=mutable-jar <1> quarkus.live-reload.password=changeit <2> quarkus.live-reload.url=http://my.cluster.host.com:8080 <3> ---- @@ -558,9 +558,9 @@ on the classpath that the legacy jar necessitates, when loading a class or resou == Building Uber-Jars -Quarkus Gradle plugin supports the generation of Uber-Jars by specifying a `quarkus.package.type` argument as follows: +Quarkus Gradle plugin supports the generation of Uber-Jars by specifying a `quarkus.package.jar.type` argument as follows: -:build-additional-parameters: -Dquarkus.package.type=uber-jar +:build-additional-parameters: -Dquarkus.package.jar.type=uber-jar include::{includes}/devtools/build.adoc[] :!build-additional-parameters: @@ -568,7 +568,7 @@ When building an Uber-Jar you can specify entries that you want to exclude from [source,bash] ---- -./gradlew quarkusBuild -Dquarkus.package.type=uber-jar --ignored-entry=META-INF/file1.txt +./gradlew quarkusBuild -Dquarkus.package.jar.type=uber-jar --ignored-entry=META-INF/file1.txt ---- The entries are relative to the root of the generated Uber-Jar. You can specify multiple entries by adding extra `--ignored-entry` arguments. @@ -620,7 +620,7 @@ tasks.withType().configureEach { There are multiple configuration sources that influence Quarkus builds, mentioned in the order of their priority. The Quarkus build uses the `prod` configuration profile: -1. System properties (for example `./gradlew -Dquarkus.package.type=fast-jar ...`) +1. System properties (for example `./gradlew -Dquarkus.package.jar.type=fast-jar ...`) 2. System environment (for example `QUARKUS_PACKAGE_TYPE=fast-jar ./gradlew ...`) 3. Configuration via the `quarkus` extensions's `quarkusBuildProperties` For example: @@ -630,7 +630,7 @@ The Quarkus build uses the `prod` configuration profile: } } -4. Configuration via Gradle project properties (for example `./gradlew -Pquarkus.package.type=fast-jar`) +4. Configuration via Gradle project properties (for example `./gradlew -Pquarkus.package.jar.type=fast-jar`) 5. Configuration from a project's `application.properties`, `application.yaml` and `application.yml` files, as well as a project's `application-prod.properties`, `application-prod.yaml` and `application-prod.yml` files diff --git a/docs/src/main/asciidoc/jreleaser.adoc b/docs/src/main/asciidoc/jreleaser.adoc index a29833dd51cbf4..19a0184157d548 100644 --- a/docs/src/main/asciidoc/jreleaser.adoc +++ b/docs/src/main/asciidoc/jreleaser.adoc @@ -709,7 +709,7 @@ As a reference, these are the full contents of the `pom.xml`: false - native + true diff --git a/docs/src/main/asciidoc/maven-tooling.adoc b/docs/src/main/asciidoc/maven-tooling.adoc index a3ecc8d5d0564a..b749eba9eb53c1 100644 --- a/docs/src/main/asciidoc/maven-tooling.adoc +++ b/docs/src/main/asciidoc/maven-tooling.adoc @@ -220,7 +220,7 @@ To do this you must build a mutable application, using the `mutable-jar` format. [source,properties] ---- -quarkus.package.type=mutable-jar <1> +quarkus.package.jar.type=mutable-jar <1> quarkus.live-reload.password=changeit <2> quarkus.live-reload.url=http://my.cluster.host.com:8080 <3> ---- @@ -541,7 +541,7 @@ If you have not used <>, add the following <7> native <8> - native + true false <9> @@ -581,8 +581,8 @@ on the classpath that the legacy jar necessitates, when loading a class or resou [[uber-jar-maven]] === Uber-Jar Creation -Quarkus Maven plugin supports the generation of Uber-Jars by specifying a `quarkus.package.type=uber-jar` configuration option in your `application.properties` -(or `uber-jar` in your `pom.xml`). +Quarkus Maven plugin supports the generation of Uber-Jars by specifying a `quarkus.package.jar.type=uber-jar` configuration option in your `application.properties` +(or `uber-jar` in your `pom.xml`). The original jar will still be present in the `target` directory, but it will be renamed to contain the `.original` suffix. @@ -596,7 +596,7 @@ Uber-Jar's final name is configurable via a Maven's build settings `finalName` o ==== Uber-Jar file name suffix By default the generated uber JAR file name will have the `-runner` suffix, unless it was overriden by configuring a custom one with `quarkus.package.runner-suffix` configuration option. -If the runner suffix is not desired, it can be disabled by setting `quarkus.package.add-runner-suffix` configuration option to `false`, in which case the uber JAR will replace the original JAR +If the runner suffix is not desired, it can be disabled by setting `quarkus.package.jar.add-runner-suffix` configuration option to `false`, in which case the uber JAR will replace the original JAR file generated by `maven-jar-plugin` for the application module. ==== Attaching Uber-Jar file as the main project artifact @@ -604,7 +604,7 @@ file generated by `maven-jar-plugin` for the application module. As long as an Uber-Jar file name is created by appending a suffix, such as `runner`, to the original project JAR file name, the Uber-Jar file name suffix will also be used as the Maven artifact classifier for the Uber-Jar artifact. There are two ways to attach an Uber-Jar as the main project artifact (without the classifier): -1. set `quarkus.package.add-runner-suffix=false`, which will disable the addition of the file name suffix and, by doing that, will replace the original project JAR on the file system; +1. set `quarkus.package.jar.add-runner-suffix=false`, which will disable the addition of the file name suffix and, by doing that, will replace the original project JAR on the file system; 2. set `attachRunnerAsMainArtifact` parameter of the `quarkus:build` goal to `true`. [[multi-module-maven]] @@ -882,7 +882,7 @@ To isolate profile-specific dependencies from other profiles, the JDBC drivers c prod-postgresql postgresql-quarkus-app true <2> - org.postgresql:postgresql::jar <3> + org.postgresql:postgresql::jar <3> @@ -898,7 +898,7 @@ To isolate profile-specific dependencies from other profiles, the JDBC drivers c <2> For backward compatibility reasons, it is necessary to explicitly indicate that the optional dependencies need to be filtered. <3> Only the optional dependency corresponding to the JDBC driver of PostgreSQL is expected in the final artifact. -NOTE: If you have more than one optional dependency to declare in the `quarkus.package.included-optional-dependencies` tag, make sure they are separated with `,` (e.g. `org.postgresql:postgresql::jar,com.foo:bar::jar`). +NOTE: If you have more than one optional dependency to declare in the `quarkus.package.jar.included-optional-dependencies` tag, make sure they are separated with `,` (e.g. `org.postgresql:postgresql::jar,com.foo:bar::jar`). [[configuration-reference]] == Configuring the Project Output diff --git a/docs/src/main/asciidoc/native-and-ssl.adoc b/docs/src/main/asciidoc/native-and-ssl.adoc index 41a3c00bd15784..23e8bb0779209f 100644 --- a/docs/src/main/asciidoc/native-and-ssl.adoc +++ b/docs/src/main/asciidoc/native-and-ssl.adoc @@ -237,7 +237,7 @@ However, this comes with a few drawbacks: * Providing all certificates at build time complicates the CI, specifically in dynamic environments such as Kubernetes where valid certificates are provided by the platform in the `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` PEM file. * Lastly, this does not play well with third party software that do not provide a dedicated build for each customer environment. -Creating a native executable using build time certificates essentially means that the root certificates are fixed at image build time, based on the certificate configuration used at build time (which for Quarkus means when you perform a build having `quarkus.package.type=native` set). +Creating a native executable using build time certificates essentially means that the root certificates are fixed at image build time, based on the certificate configuration used at build time (which for Quarkus means when you perform a build having `quarkus.native.enabled=true` set). This avoids shipping a `cacerts` file or requiring a system property be set in order to set up root certificates that are provided by the OS where the binary runs. In this situation, system properties such as `javax.net.ssl.trustStore` do not have an effect at diff --git a/docs/src/main/asciidoc/reaugmentation.adoc b/docs/src/main/asciidoc/reaugmentation.adoc index 3458f8ffac0978..e27fece3d6a829 100644 --- a/docs/src/main/asciidoc/reaugmentation.adoc +++ b/docs/src/main/asciidoc/reaugmentation.adoc @@ -37,7 +37,7 @@ It is not a good idea to do re-augmentation at runtime unless you miss the good == How to re-augment a Quarkus application In order to run the augmentation steps you need the deployment JARs of the used Quarkus extensions. -These JARs are only present in the `mutable-jar` distribution. This means that you need to build your application with `quarkus.package.type=mutable-jar`. +These JARs are only present in the `mutable-jar` distribution. This means that you need to build your application with `quarkus.package.jar.type=mutable-jar`. The `mutable-jar` distribution is the same as the `fast-jar` distribution, except for the additional folder `quarkus-app/lib/deployment` which contains the deployment JARs and their dependencies (and some class-loader configuration). @@ -54,7 +54,7 @@ configuration files. [source,bash] ---- -mvn clean install -Dquarkus.package.type=mutable-jar +mvn clean install -Dquarkus.package.jar.type=mutable-jar ---- === 2. Re-augment your application with a different build time configuration diff --git a/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml index 9335fa2590a1ee..2cc9a171a0fbae 100644 --- a/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -129,7 +129,7 @@ - native + true diff --git a/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml index a9c2727f664d53..4e16c9f1b0b767 100644 --- a/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -129,7 +129,7 @@ - native + true diff --git a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml index 13f4b3dc933465..bbf124a392a5a7 100644 --- a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -108,7 +108,7 @@ - native + true diff --git a/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java b/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java index 9c23eec031b807..0a4bb08f97ef78 100644 --- a/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java +++ b/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java @@ -66,8 +66,8 @@ public class AzureFunctionsProcessor { @BuildStep public LegacyJarRequiredBuildItem forceLegacy(PackageConfig config) { + // TODO: Instead of this, consume a LegacyJarBuildItem // Azure Functions need a legacy jar and no runner - config.addRunnerSuffix = false; return new LegacyJarRequiredBuildItem(); } @@ -98,7 +98,7 @@ public ArtifactResultBuildItem packageFunctions(List fun for (AzureFunctionBuildItem item : functions) methods.add(item.getMethod()); final Map configMap = handler.generateConfigurations(methods); - final String scriptFilePath = String.format("../%s.jar", target.getBaseName() + packageConfig.getRunnerSuffix()); + final String scriptFilePath = String.format("../%s.jar", target.getBaseName() + packageConfig.computedRunnerSuffix()); configMap.values().forEach(config -> config.setScriptFile(scriptFilePath)); configMap.values().forEach(FunctionConfiguration::validate); diff --git a/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java b/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java index d8b6efe266530a..b40283807e712d 100644 --- a/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java +++ b/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java @@ -33,7 +33,6 @@ import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.MainClassBuildItem; -import io.quarkus.deployment.pkg.PackageConfig; import io.quarkus.deployment.pkg.builditem.AppCDSResultBuildItem; import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; @@ -63,7 +62,6 @@ public AvailableContainerImageExtensionBuildItem availability() { @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, BuildpackBuild.class }, onlyIfNot = NativeBuild.class) public void buildFromJar(ContainerImageConfig containerImageConfig, BuildpackConfig buildpackConfig, - PackageConfig packageConfig, ContainerImageInfoBuildItem containerImage, JarBuildItem sourceJar, MainClassBuildItem mainClass, diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java index bc8ca177fa2326..5c94f9c13715b5 100644 --- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java +++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java @@ -4,6 +4,7 @@ import static io.quarkus.container.image.deployment.util.EnablementUtil.buildContainerImageNeeded; import static io.quarkus.container.image.deployment.util.EnablementUtil.pushContainerImageNeeded; import static io.quarkus.container.util.PathsUtil.findMainSourcesRoot; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.deployment.util.ContainerRuntimeUtil.detectContainerRuntime; import java.nio.file.Files; @@ -339,6 +340,7 @@ private RuntimeException dockerException(String executableName, String[] dockerA + "' failed. See docker output for more details"); } + @SuppressWarnings("deprecation") // legacy JAR private DockerfilePaths getDockerfilePaths(DockerConfig dockerConfig, boolean forNative, PackageConfig packageConfig, OutputTargetBuildItem outputTargetBuildItem) { @@ -352,7 +354,7 @@ private DockerfilePaths getDockerfilePaths(DockerConfig dockerConfig, boolean fo } else { if (dockerConfig.dockerfileJvmPath.isPresent()) { return ProvidedDockerfile.get(Paths.get(dockerConfig.dockerfileJvmPath.get()), outputDirectory); - } else if (packageConfig.isLegacyJar()) { + } else if (packageConfig.jar().type() == LEGACY_JAR) { return DockerfileDetectionResult.detect(DOCKERFILE_LEGACY_JAR, outputDirectory); } else { return DockerfileDetectionResult.detect(DOCKERFILE_JVM, outputDirectory); diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java index d9988bc6b79c5c..a245688b8f7eac 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java @@ -56,7 +56,7 @@ public class ContainerImageJibConfig { *
      *
    • Entrypoint "INHERIT" means to inherit entrypoint from base image, {@code jvmArguments} field is used for * arguments
    • - *
    • A valid entrypoint is jar package specific (see {@code quarkus.package.type})
    • + *
    • A valid entrypoint is jar package specific (see {@code quarkus.package.jar.type})
    • *
    • A valid entrypoint depends on the location of both the launching scripts and the application jar file. To that * end it's helpful to remember that when {@code fast-jar} packaging is used (the default), all necessary application * jars are added to the {@code /work} directory and that the same diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java index 90c49d23397805..20ba3aea728c91 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java @@ -6,6 +6,7 @@ import static io.quarkus.container.image.deployment.util.EnablementUtil.buildContainerImageNeeded; import static io.quarkus.container.image.deployment.util.EnablementUtil.pushContainerImageNeeded; import static io.quarkus.container.util.PathsUtil.findMainSourcesRoot; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import java.io.IOException; import java.io.UncheckedIOException; @@ -151,6 +152,7 @@ private String determineBaseJvmImage(ContainerImageJibConfig jibConfig, Compiled return JAVA_17_BASE_IMAGE; } + @SuppressWarnings("deprecation") // legacy JAR @BuildStep(onlyIf = { IsNormal.class, JibBuild.class }, onlyIfNot = NativeBuild.class) public void buildFromJar(ContainerImageConfig containerImageConfig, ContainerImageJibConfig jibConfig, PackageConfig packageConfig, @@ -175,20 +177,20 @@ public void buildFromJar(ContainerImageConfig containerImageConfig, ContainerIma } JibContainerBuilder jibContainerBuilder; - String packageType = packageConfig.type; - if (packageConfig.isLegacyJar() || packageType.equalsIgnoreCase(PackageConfig.BuiltInType.UBER_JAR.getValue()) + PackageConfig.JarConfig.JarType jarType = packageConfig.jar().type(); + if (jarType == LEGACY_JAR || jarType == UBER_JAR || !uberJarRequired.isEmpty()) { jibContainerBuilder = createContainerBuilderFromLegacyJar(determineBaseJvmImage(jibConfig, compiledJavaVersion), jibConfig, containerImageConfig, sourceJar, outputTarget, mainClass, containerImageLabels); - } else if (packageConfig.isFastJar()) { + } else if (jarType == FAST_JAR || jarType == MUTABLE_JAR) { jibContainerBuilder = createContainerBuilderFromFastJar(determineBaseJvmImage(jibConfig, compiledJavaVersion), jibConfig, containerImageConfig, sourceJar, curateOutcome, containerImageLabels, - appCDSResult, packageType.equals(PackageConfig.BuiltInType.MUTABLE_JAR.getValue())); + appCDSResult, jarType == MUTABLE_JAR); } else { throw new IllegalArgumentException( - "Package type '" + packageType + "' is not supported by the container-image-jib extension"); + "JAR type '" + jarType + "' is not supported by the container-image-jib extension"); } setUser(jibConfig, jibContainerBuilder); setPlatforms(jibConfig, jibContainerBuilder); diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java index 8d4cc5bacc11b0..369e9bfa6da1d4 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java @@ -4,6 +4,7 @@ import static io.quarkus.container.image.openshift.deployment.OpenshiftUtils.getNamespace; import static io.quarkus.container.image.openshift.deployment.OpenshiftUtils.mergeConfig; import static io.quarkus.container.util.PathsUtil.findMainSourcesRoot; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.deployment.pkg.steps.JarResultBuildStep.DEFAULT_FAST_JAR_DIRECTORY_NAME; import java.io.BufferedReader; @@ -287,10 +288,12 @@ public void openshiftBuildFromJar(ContainerImageOpenshiftConfig openshiftConfig, //For docker kind of builds where we use instructions like: `COPY target/*.jar /deployments` it using '/target' is a requirement. //For s2i kind of builds where jars are expected directly in the '/' we have to use null. String outputDirName = out.getOutputDirectory().getFileName().toString(); - String contextRoot = getContextRoot(outputDirName, packageConfig.isFastJar(), config.buildStrategy); + PackageConfig.JarConfig.JarType jarType = packageConfig.jar().type(); + String contextRoot = getContextRoot(outputDirName, jarType == FAST_JAR || jarType == MUTABLE_JAR, + config.buildStrategy); KubernetesClientBuilder clientBuilder = newClientBuilderWithoutHttp2(kubernetesClient.getConfiguration(), kubernetesClientBuilder.getHttpClientFactory()); - if (packageConfig.isFastJar()) { + if (jarType == FAST_JAR || jarType == MUTABLE_JAR) { createContainerImage(clientBuilder, openshiftYml.get(), config, contextRoot, jar.getPath().getParent(), jar.getPath().getParent()); } else if (jar.getLibraryDir() != null) { //When using uber-jar the libraryDir is going to be null, potentially causing NPE. diff --git a/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml index 778c3c6dec486d..5dbc2bdc9affb3 100644 --- a/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -98,7 +98,7 @@ - native + true diff --git a/extensions/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java b/extensions/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java index 8ffcc6d0ca0eec..e76bc8d07726f6 100644 --- a/extensions/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java +++ b/extensions/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java @@ -31,7 +31,7 @@ public ArtifactResultBuildItem functionDeployment(OutputTargetBuildItem target, throws BuildException, IOException { if (!jar.isUberJar()) { throw new BuildException("Google Cloud Function deployment need to use a uberjar, " + - "please set 'quarkus.package.type=uber-jar' inside your application.properties", + "please set 'quarkus.package.jar.type=uber-jar' inside your application.properties", Collections.EMPTY_LIST); } diff --git a/extensions/google-cloud-functions-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java b/extensions/google-cloud-functions-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java index 25dbcf3ce150cd..98a11b51c5abe0 100644 --- a/extensions/google-cloud-functions-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java +++ b/extensions/google-cloud-functions-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java @@ -30,7 +30,7 @@ public ArtifactResultBuildItem functionDeployment(OutputTargetBuildItem target, throws BuildException, IOException { if (!jar.isUberJar()) { throw new BuildException("Google Cloud Function deployment need to use a uberjar, " + - "please set 'quarkus.package.type=uber-jar' inside your application.properties", + "please set 'quarkus.package.jar.type=uber-jar' inside your application.properties", Collections.EMPTY_LIST); } diff --git a/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java b/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java index 7e44844e743f8c..24bdf5cadb3500 100644 --- a/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java +++ b/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java @@ -38,7 +38,7 @@ public ArtifactResultBuildItem functionDeployment(OutputTargetBuildItem target, throws BuildException, IOException { if (!jar.isUberJar()) { throw new BuildException("Google Cloud Function deployment need to use a uberjar, " + - "please set 'quarkus.package.type=uber-jar' inside your application.properties", + "please set 'quarkus.package.jar.type=uber-jar' inside your application.properties", Collections.EMPTY_LIST); } diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java index 7a4c4405ff3ff6..eeb0e60e4b906b 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java @@ -125,7 +125,8 @@ public static Optional createProject(ApplicationInfoBuildItem app, Optional customProjectRoot, OutputTargetBuildItem outputTarget, PackageConfig packageConfig) { return createProject(app, customProjectRoot, outputTarget.getOutputDirectory() - .resolve(String.format(OUTPUT_ARTIFACT_FORMAT, outputTarget.getBaseName(), packageConfig.getRunnerSuffix()))); + .resolve(String.format(OUTPUT_ARTIFACT_FORMAT, outputTarget.getBaseName(), + packageConfig.computedRunnerSuffix()))); } public static Optional createProject(ApplicationInfoBuildItem app, diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java index bb2fac1682e0fc..dbf5ab08bb887c 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java @@ -1,5 +1,6 @@ package io.quarkus.kubernetes.deployment; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; import static io.quarkus.deployment.pkg.steps.JarResultBuildStep.DEFAULT_FAST_JAR_DIRECTORY_NAME; import static io.quarkus.deployment.pkg.steps.JarResultBuildStep.QUARKUS_RUN_JAR; import static io.quarkus.kubernetes.deployment.Constants.KUBERNETES; @@ -264,18 +265,19 @@ private Path getRunner(OutputTargetBuildItem outputTarget, PackageConfig packageConfig, List uberJarRequired, List legacyJarRequired) { - if (!legacyJarRequired.isEmpty() || packageConfig.isLegacyJar() + PackageConfig.JarConfig.JarType jarType = packageConfig.jar().type(); + if (!legacyJarRequired.isEmpty() || jarType == LEGACY_JAR || !uberJarRequired.isEmpty() - || packageConfig.type.equalsIgnoreCase(PackageConfig.BuiltInType.UBER_JAR.getValue())) { + || jarType == UBER_JAR) { // the jar is a legacy jar or uber jar, the next logic applies: return outputTarget.getOutputDirectory() - .resolve(outputTarget.getBaseName() + packageConfig.getRunnerSuffix() + ".jar"); + .resolve(outputTarget.getBaseName() + packageConfig.computedRunnerSuffix() + ".jar"); } // otherwise, it's a thin jar: Path buildDir; - if (packageConfig.outputDirectory.isPresent()) { + if (packageConfig.outputDirectory().isPresent()) { buildDir = outputTarget.getOutputDirectory(); } else { buildDir = outputTarget.getOutputDirectory().resolve(DEFAULT_FAST_JAR_DIRECTORY_NAME); diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java index e2ab7c880eaed0..7e6134ba7f70a5 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java @@ -92,7 +92,7 @@ import io.quarkus.deployment.builditem.ServiceStartBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import io.quarkus.deployment.pkg.PackageConfig; +import io.quarkus.deployment.pkg.NativeConfig; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.fs.util.ZipUtils; import io.quarkus.gizmo.ClassOutput; @@ -940,7 +940,7 @@ void validateExpressions(TemplatesAnalysisBuildItem templatesAnalysis, List checkedTemplates, List templateData, QuteConfig config, - PackageConfig packageConfig, + NativeConfig nativeConfig, List globals) { long start = System.nanoTime(); @@ -1035,7 +1035,7 @@ public String apply(String id) { // ========================================================================== // Register implicit value resolvers for classes collected during validation // ========================================================================== - boolean isNonNativeBuild = !packageConfig.isNativeOrNativeSources(); + boolean isNonNativeBuild = !nativeConfig.enabled(); for (Entry> entry : implicitClassToMembersUsed.entrySet()) { if (entry.getValue().isEmpty() && isNonNativeBuild) { // No members used - skip the generation for non-native builds diff --git a/extensions/resteasy-classic/resteasy-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java b/extensions/resteasy-classic/resteasy-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java index 6ef4d9684adcfa..258cc940a8d5a1 100644 --- a/extensions/resteasy-classic/resteasy-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java +++ b/extensions/resteasy-classic/resteasy-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java @@ -78,7 +78,7 @@ import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem; -import io.quarkus.deployment.pkg.PackageConfig; +import io.quarkus.deployment.pkg.NativeConfig; import io.quarkus.gizmo.MethodDescriptor; import io.quarkus.gizmo.ResultHandle; import io.quarkus.restclient.NoopHostnameVerifier; @@ -190,7 +190,7 @@ void processInterfaces( BeanArchiveIndexBuildItem beanArchiveIndexBuildItem, Capabilities capabilities, Optional metricsCapability, - PackageConfig packageConfig, + NativeConfig nativeConfig, List restClientProviders, BuildProducer proxyDefinition, BuildProducer reflectiveClass, @@ -216,7 +216,7 @@ void processInterfaces( restClient.produce(new RestClientBuildItem(interfaze.toString())); } - warnAboutNotWorkingFeaturesInNative(packageConfig, interfaces); + warnAboutNotWorkingFeaturesInNative(nativeConfig, interfaces); for (Map.Entry entry : interfaces.entrySet()) { String iName = entry.getKey().toString(); @@ -318,8 +318,8 @@ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() { // that is annotated with ClientHeaderParam // leads to NPEs (see https://github.com/quarkusio/quarkus/issues/10249) // so let's warn users about its use - private void warnAboutNotWorkingFeaturesInNative(PackageConfig packageConfig, Map interfaces) { - if (!packageConfig.type.equalsIgnoreCase(PackageConfig.NATIVE)) { + private void warnAboutNotWorkingFeaturesInNative(NativeConfig nativeConfig, Map interfaces) { + if (!nativeConfig.enabled()) { return; } Set dotNames = new HashSet<>(); diff --git a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java index a7fbaaf827eac1..8b9326ecc224fc 100644 --- a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java +++ b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java @@ -11,6 +11,15 @@ public static GACT fromString(String str) { return new GACT(split(str, new String[4], str.length())); } + /** + * Parse method for configuration. + * + * @see #fromString(String) + */ + public static GACT parse(String str) { + return fromString(str); + } + protected final String groupId; protected final String artifactId; protected final String classifier; diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/JarResult.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/JarResult.java index 0a0f5a27d3c01d..d57671f72828d8 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/JarResult.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/JarResult.java @@ -7,14 +7,14 @@ public final class JarResult { private final Path path; private final Path originalArtifact; private final Path libraryDir; - private final String type; + private final boolean mutable; private final String classifier; - public JarResult(Path path, Path originalArtifact, Path libraryDir, String type, String classifier) { + public JarResult(Path path, Path originalArtifact, Path libraryDir, boolean mutable, String classifier) { this.path = path; this.originalArtifact = originalArtifact; this.libraryDir = libraryDir; - this.type = type; + this.mutable = mutable; this.classifier = classifier; } @@ -34,8 +34,8 @@ public Path getOriginalArtifact() { return originalArtifact; } - public String getType() { - return type; + public boolean mutable() { + return mutable; } public String getClassifier() { diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java index 439eb6e98d3c30..4b5c60c0bdd934 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java @@ -86,7 +86,7 @@ public static Map postBuild(Path appClasses, Path pomFile, List< .build().bootstrap(); if (nativeImage) { - System.setProperty("quarkus.package.type", "native"); + System.setProperty("quarkus.native.enabled", "true"); } Map output = new HashMap<>(); app.runInAugmentClassLoader("io.quarkus.deployment.jbang.JBangAugmentorImpl", output); diff --git a/independent-projects/bootstrap/maven-resolver/src/test/resources/modules-in-profiles/runner/pom.xml b/independent-projects/bootstrap/maven-resolver/src/test/resources/modules-in-profiles/runner/pom.xml index 5a3c9ebe88722f..517f95d3115c56 100644 --- a/independent-projects/bootstrap/maven-resolver/src/test/resources/modules-in-profiles/runner/pom.xml +++ b/independent-projects/bootstrap/maven-resolver/src/test/resources/modules-in-profiles/runner/pom.xml @@ -45,7 +45,7 @@ - native + true diff --git a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/QuarkusEntryPoint.java b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/QuarkusEntryPoint.java index 2f2de3dedad656..1460516db4c2d0 100644 --- a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/QuarkusEntryPoint.java +++ b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/QuarkusEntryPoint.java @@ -71,7 +71,7 @@ private static void doReaugment(Path appRoot) throws IOException, ClassNotFoundE InvocationTargetException, NoSuchMethodException { if (!Files.exists(appRoot.resolve(LIB_DEPLOYMENT_DEPLOYMENT_CLASS_PATH_DAT))) { System.out.println("[ERROR] Re-augmentation was requested, " + - "but the application wasn't built with 'quarkus.package.type=mutable-jar'"); + "but the application wasn't built with 'quarkus.package.jar.type=mutable-jar'"); return; } try (ObjectInputStream in = new ObjectInputStream( diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/integration-tests/java/integration-tests/pom.tpl.qute.xml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/integration-tests/java/integration-tests/pom.tpl.qute.xml index 9237988338bab8..6f75152063220b 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/integration-tests/java/integration-tests/pom.tpl.qute.xml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/integration-tests/java/integration-tests/pom.tpl.qute.xml @@ -99,7 +99,7 @@ - native + true false diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle-kotlin-dsl/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle-kotlin-dsl/codestart.yml index 6a922b02e7cf12..08d4517e30c10f 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle-kotlin-dsl/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle-kotlin-dsl/codestart.yml @@ -14,10 +14,10 @@ language: cmd: dev: quarkusDev package: build - package-uber-jar: build -Dquarkus.package.type=uber-jar - package-legacy-jar: build -Dquarkus.package.type=legacy-jar - package-native: build -Dquarkus.package.type=native - package-native-container: build -Dquarkus.package.type=native -Dquarkus.native.container-build=true + package-uber-jar: build -Dquarkus.package.jar.type=uber-jar + package-legacy-jar: build -Dquarkus.package.jar.type=legacy-jar + package-native: build -Dquarkus.native.enabled=true + package-native-container: build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true build-ci: build kotlin: dependencies: diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle/codestart.yml index a0959b85c4253c..2209839bbaaaf7 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/gradle/codestart.yml @@ -14,10 +14,10 @@ language: cmd: dev: quarkusDev package: build - package-uber-jar: build -Dquarkus.package.type=uber-jar - package-legacy-jar: build -Dquarkus.package.type=legacy-jar - package-native: build -Dquarkus.package.type=native - package-native-container: build -Dquarkus.package.type=native -Dquarkus.native.container-build=true + package-uber-jar: build -Dquarkus.package.jar.type=uber-jar + package-legacy-jar: build -Dquarkus.package.jar.type=legacy-jar + package-native: build -Dquarkus.native.enabled=true + package-native-container: build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true build-ci: build kotlin: dependencies: diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/base/pom.tpl.qute.xml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/base/pom.tpl.qute.xml index f4d187b6246624..ac046389bab46b 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/base/pom.tpl.qute.xml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/base/pom.tpl.qute.xml @@ -26,7 +26,7 @@ true {maven-surefire-plugin.version} {#if uberjar} - uber-jar + uber-jar {/if} @@ -202,7 +202,7 @@ - native + true false diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/codestart.yml index 8e29627a8d10aa..8c58d9d38e0f75 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/codestart.yml @@ -13,8 +13,8 @@ language: cmd: dev: compile quarkus:dev package: package - package-uber-jar: package -Dquarkus.package.type=uber-jar - package-legacy-jar: package -Dquarkus.package.type=legacy-jar + package-uber-jar: package -Dquarkus.package.jar.type=uber-jar + package-legacy-jar: package -Dquarkus.package.jar.type=legacy-jar package-native: package -Dnative package-native-container: package -Dnative -Dquarkus.native.container-build=true build-ci: verify -B diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java index 3df62f156b9b57..5e9b07e64e727e 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java @@ -319,7 +319,7 @@ private void checkDockerfilesWithMaven(Path projectDir) { .satisfies(checkContains("ENV JAVA_APP_JAR=\"/deployments/quarkus-run.jar\"")) .satisfies(checkContains("ENTRYPOINT [ \"/opt/jboss/container/java/run/run-java.sh\" ]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.legacy-jar")).exists() - .satisfies(checkContains("./mvnw package -Dquarkus.package.type=legacy-jar")) + .satisfies(checkContains("./mvnw package -Dquarkus.package.jar.type=legacy-jar")) .satisfies(checkContains("docker build -f src/main/docker/Dockerfile.legacy-jar")) .satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-17:1.18")) .satisfies(checkContains("EXPOSE 8080")) @@ -345,7 +345,7 @@ private void checkDockerfilesWithGradle(Path projectDir) { .satisfies(checkContains("ENV JAVA_APP_JAR=\"/deployments/quarkus-run.jar\"")) .satisfies(checkContains("ENTRYPOINT [ \"/opt/jboss/container/java/run/run-java.sh\" ]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.legacy-jar")).exists() - .satisfies(checkContains("./gradlew build -Dquarkus.package.type=legacy-jar")) + .satisfies(checkContains("./gradlew build -Dquarkus.package.jar.type=legacy-jar")) .satisfies(checkContains("docker build -f src/main/docker/Dockerfile.legacy-jar")) .satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-17:1.18")) .satisfies(checkContains("EXPOSE 8080")) @@ -353,11 +353,11 @@ private void checkDockerfilesWithGradle(Path projectDir) { .satisfies(checkContains("ENV JAVA_APP_JAR=\"/deployments/quarkus-run.jar\"")) .satisfies(checkContains("ENTRYPOINT [ \"/opt/jboss/container/java/run/run-java.sh\" ]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.native-micro")).exists() - .satisfies(checkContains("./gradlew build -Dquarkus.package.type=native")) + .satisfies(checkContains("./gradlew build -Dquarkus.native.enabled=true")) .satisfies(checkContains("quay.io/quarkus/quarkus-micro-image:2.0")) .satisfies(checkContains("ENTRYPOINT [\"./application\", \"-Dquarkus.http.host=0.0.0.0\"]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.native")).exists() - .satisfies(checkContains("./gradlew build -Dquarkus.package.type=native")) + .satisfies(checkContains("./gradlew build -Dquarkus.native.enabled=true")) .satisfies(checkContains("registry.access.redhat.com/ubi8/ubi-minimal")) .satisfies(checkContains("ENTRYPOINT [\"./application\", \"-Dquarkus.http.host=0.0.0.0\"]")); } diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md index 46cfc840738fa4..a78fe368b4e64a 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/README.md @@ -26,7 +26,7 @@ The application is now runnable using `java -jar target/quarkus-app/quarkus-run. If you want to build an _über-jar_, execute the following command: ```shell script -mvn package -Dquarkus.package.type=uber-jar +mvn package -Dquarkus.package.jar.type=uber-jar ``` The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`. diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/pom.xml b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/pom.xml index 28937572322efc..27a50efb132f64 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/pom.xml +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateDefault/pom.xml @@ -105,7 +105,7 @@ false - native + true diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml index 6abb5fb8568747..14c9a297257aa5 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml @@ -120,7 +120,7 @@ false - native + true diff --git a/integration-tests/amazon-lambda-rest-funqy/pom.xml b/integration-tests/amazon-lambda-rest-funqy/pom.xml index 5a103a70f72c2e..62edff0bf212e6 100644 --- a/integration-tests/amazon-lambda-rest-funqy/pom.xml +++ b/integration-tests/amazon-lambda-rest-funqy/pom.xml @@ -111,7 +111,7 @@ - native + true diff --git a/integration-tests/amazon-lambda-rest-reactive-routes/pom.xml b/integration-tests/amazon-lambda-rest-reactive-routes/pom.xml index fedde86088ecb0..60207c326ebddc 100644 --- a/integration-tests/amazon-lambda-rest-reactive-routes/pom.xml +++ b/integration-tests/amazon-lambda-rest-reactive-routes/pom.xml @@ -111,7 +111,7 @@ - native + true diff --git a/integration-tests/amazon-lambda-rest-resteasy-reactive/pom.xml b/integration-tests/amazon-lambda-rest-resteasy-reactive/pom.xml index 4a71a8d3cbb2ac..f162cce9f6e1ce 100644 --- a/integration-tests/amazon-lambda-rest-resteasy-reactive/pom.xml +++ b/integration-tests/amazon-lambda-rest-resteasy-reactive/pom.xml @@ -111,7 +111,7 @@ - native + true diff --git a/integration-tests/amazon-lambda-rest-servlet/pom.xml b/integration-tests/amazon-lambda-rest-servlet/pom.xml index 77a90b5cfcaf3c..9ab3bdd6096eec 100644 --- a/integration-tests/amazon-lambda-rest-servlet/pom.xml +++ b/integration-tests/amazon-lambda-rest-servlet/pom.xml @@ -111,7 +111,7 @@ - native + true diff --git a/integration-tests/bouncycastle-fips/pom.xml b/integration-tests/bouncycastle-fips/pom.xml index 09b8805d2fd731..3a3945fb9ac29f 100644 --- a/integration-tests/bouncycastle-fips/pom.xml +++ b/integration-tests/bouncycastle-fips/pom.xml @@ -102,7 +102,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/bouncycastle/pom.xml b/integration-tests/bouncycastle/pom.xml index 4781fa6efee7c7..ba1d4195597102 100644 --- a/integration-tests/bouncycastle/pom.xml +++ b/integration-tests/bouncycastle/pom.xml @@ -102,7 +102,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-docker/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-docker/pom.xml index e8eb80caa0e6b4..7fc4e14c4ea235 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-docker/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-docker/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/pom.xml index e625547f39334d..d0b0856e249893 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/src/main/resources/application.properties b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/src/main/resources/application.properties index 8c13e8552019a5..721ff430edcc63 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/src/main/resources/application.properties +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-appcds/src/main/resources/application.properties @@ -1,6 +1,6 @@ # Configuration file # key = value -quarkus.package.type=fast-jar -quarkus.package.create-appcds=true +quarkus.package.jar.type=fast-jar +quarkus.package.jar.appcds.enable=true # -Xshare:on ensures that the AppCDS file will be used - if it can't, the JVM terminates quarkus.jib.jvm-arguments=-Djava.util.logging.manager=org.jboss.logmanager.LogManager,-Xshare:on diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/pom.xml index d6dbec2b166047..1cdb4c21ffe978 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/src/main/resources/application.properties b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/src/main/resources/application.properties index 22994823ba77be..599454946a9997 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/src/main/resources/application.properties +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib-inherit/src/main/resources/application.properties @@ -1,6 +1,6 @@ # Configuration file # key = value -quarkus.package.type=fast-jar +quarkus.package.jar.type=fast-jar quarkus.jib.jvm-arguments=java,-Djava.util.logging.manager=org.jboss.logmanager.LogManager,-jar,quarkus-run.jar quarkus.jib.jvm-entrypoint=INHERIT quarkus.jib.native-arguments=./application diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/pom.xml index bde2a90ae441ce..4aa26bda3d1028 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/pom.xml @@ -91,7 +91,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-docker/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-docker/pom.xml index ba305f6777ef17..9d9ef8f205fbde 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-docker/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-docker/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-jib/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-jib/pom.xml index 17bea3810df886..ac813c39bed00f 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-jib/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-multiple-tags-jib/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-image-push/pom.xml b/integration-tests/container-image/maven-invoker-way/src/it/container-image-push/pom.xml index bb8762c9379d03..cf083f4eb72f36 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-image-push/pom.xml +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-image-push/pom.xml @@ -68,7 +68,7 @@ - native + true diff --git a/integration-tests/elytron-security/pom.xml b/integration-tests/elytron-security/pom.xml index 29ec2f576afce3..36b3a9ca66088b 100644 --- a/integration-tests/elytron-security/pom.xml +++ b/integration-tests/elytron-security/pom.xml @@ -99,7 +99,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/gradle/src/main/resources/build-configuration/with-application-properties/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/build-configuration/with-application-properties/src/main/resources/application.properties index b266d74653a4d6..b123dd68e4638d 100644 --- a/integration-tests/gradle/src/main/resources/build-configuration/with-application-properties/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/build-configuration/with-application-properties/src/main/resources/application.properties @@ -1,5 +1,5 @@ # Configuration file # key = value my-app-name=${quarkus.application.name} -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar quarkus.package.output-directory=application-properties-output-dir \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/build-configuration/with-build-configuration/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/build-configuration/with-build-configuration/src/main/resources/application.properties index 8a17d7feeb16b5..8f4f19f13aca51 100644 --- a/integration-tests/gradle/src/main/resources/build-configuration/with-build-configuration/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/build-configuration/with-build-configuration/src/main/resources/application.properties @@ -1,5 +1,5 @@ # Configuration file # key = value my-app-name=${quarkus.application.name} -quarkus.package.type=fast-jar +quarkus.package.jar.type=fast-jar quarkus.package.output-directory=build-gradle-output-dir diff --git a/integration-tests/gradle/src/main/resources/custom-config-java-module/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/custom-config-java-module/src/main/resources/application.properties index 0410d619f1af51..cf894e2f28d674 100644 --- a/integration-tests/gradle/src/main/resources/custom-config-java-module/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/custom-config-java-module/src/main/resources/application.properties @@ -1 +1 @@ -quarkus.package.type=uber-jar \ No newline at end of file +quarkus.package.jar.type=uber-jar \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/mutable-jar/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/mutable-jar/src/main/resources/application.properties index 256ad245f801eb..d64d607773c6cd 100644 --- a/integration-tests/gradle/src/main/resources/mutable-jar/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/mutable-jar/src/main/resources/application.properties @@ -1,5 +1,5 @@ # Configuration file # key = value my-app-name=${quarkus.application.name} -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar diff --git a/integration-tests/gradle/src/main/resources/mutable-jar/src/test/resources/application.properties b/integration-tests/gradle/src/main/resources/mutable-jar/src/test/resources/application.properties index e663ea0665a727..4858f376d5e184 100644 --- a/integration-tests/gradle/src/main/resources/mutable-jar/src/test/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/mutable-jar/src/test/resources/application.properties @@ -2,6 +2,6 @@ # key = value example.message=Hello from Test test-only=Test only -quarkus.package.type=fast-jar +quarkus.package.jar.type=fast-jar diff --git a/integration-tests/gradle/src/main/resources/test-that-fast-jar-format-works/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/test-that-fast-jar-format-works/src/main/resources/application.properties index a35c02d4888fcf..79050bdede3593 100644 --- a/integration-tests/gradle/src/main/resources/test-that-fast-jar-format-works/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/test-that-fast-jar-format-works/src/main/resources/application.properties @@ -1,4 +1,4 @@ # Configuration file # key = value my-app-name=${quarkus.application.name} -quarkus.package.type=fast-jar +quarkus.package.jar.type=fast-jar diff --git a/integration-tests/gradle/src/main/resources/test-that-legacy-jar-format-works/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/test-that-legacy-jar-format-works/src/main/resources/application.properties index 05a9559a3f1558..d517f3a670ea50 100644 --- a/integration-tests/gradle/src/main/resources/test-that-legacy-jar-format-works/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/test-that-legacy-jar-format-works/src/main/resources/application.properties @@ -1,3 +1,3 @@ # Configuration file # key = value -quarkus.package.type=legacy-jar +quarkus.package.jar.type=legacy-jar diff --git a/integration-tests/gradle/src/main/resources/test-uber-jar-format-works/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/test-uber-jar-format-works/src/main/resources/application.properties index 109410b9b21db6..09d2ff467d64ae 100644 --- a/integration-tests/gradle/src/main/resources/test-uber-jar-format-works/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/test-uber-jar-format-works/src/main/resources/application.properties @@ -1,4 +1,4 @@ # Configuration file # key = value my-app-name=${quarkus.application.name} -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar diff --git a/integration-tests/gradle/src/main/resources/uber-jar-for-multi-module-project/application/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/uber-jar-for-multi-module-project/application/src/main/resources/application.properties index cc666b3ffd9684..d4265a8cbdb852 100644 --- a/integration-tests/gradle/src/main/resources/uber-jar-for-multi-module-project/application/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/uber-jar-for-multi-module-project/application/src/main/resources/application.properties @@ -1,3 +1,3 @@ # Configuration file # key = value -quarkus.package.type=uber-jar \ No newline at end of file +quarkus.package.jar.type=uber-jar \ No newline at end of file diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/BuildConfigurationTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/BuildConfigurationTest.java index 22022d77024fd2..8135b4417dc68f 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/BuildConfigurationTest.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/BuildConfigurationTest.java @@ -101,7 +101,7 @@ void verify(String packageType) { private void verifyBuild(String override) throws IOException, InterruptedException, URISyntaxException { File rootDir = getProjectDir(ROOT_PROJECT_NAME); BuildResult buildResult = runGradleWrapper(rootDir, "clean", "quarkusBuild", - override != null ? "-Dquarkus.package.type=" + override : "-Dfoo=bar"); + override != null ? "-Dquarkus.package.jar.type=" + override : "-Dfoo=bar"); soft.assertThat(buildResult.unsuccessfulTasks()).isEmpty(); // Sub project 'with-application-properties diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/ConditionalDependenciesTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/ConditionalDependenciesTest.java index 7d0a4f49b16ef4..d487b3b7ff5cdb 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/ConditionalDependenciesTest.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/ConditionalDependenciesTest.java @@ -76,7 +76,7 @@ public void shouldImportConditionalDependency() throws IOException, URISyntaxExc final File projectDir = getProjectDir("conditional-test-project"); - runGradleWrapper(projectDir, "clean", ":runner:quarkusBuild", "-Dquarkus.package.type=mutable-jar"); + runGradleWrapper(projectDir, "clean", ":runner:quarkusBuild", "-Dquarkus.package.jar.type=mutable-jar"); final File buildDir = new File(projectDir, "runner" + File.separator + "build"); final Path mainLib = buildDir.toPath().resolve("quarkus-app").resolve("lib").resolve("main"); @@ -139,7 +139,7 @@ public void scenarioTwo() throws Exception { final File projectDir = getProjectDir("conditional-test-project"); - runGradleWrapper(projectDir, "clean", ":scenario-two:quarkusBuild", "-Dquarkus.package.type=mutable-jar"); + runGradleWrapper(projectDir, "clean", ":scenario-two:quarkusBuild", "-Dquarkus.package.jar.type=mutable-jar"); final File buildDir = new File(projectDir, "scenario-two" + File.separator + "build"); final Path mainLib = buildDir.toPath().resolve("quarkus-app").resolve("lib").resolve("main"); diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/DependencyConstraintsTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/DependencyConstraintsTest.java index 366d71eaaca942..08df2f4962aba5 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/DependencyConstraintsTest.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/DependencyConstraintsTest.java @@ -13,7 +13,8 @@ public class DependencyConstraintsTest extends QuarkusGradleWrapperTestBase { public void shoudBuildProjectWithDependencyConstraint() throws Exception { File projectDir = getProjectDir("dependency-constraints-project"); - BuildResult buildResult = runGradleWrapper(projectDir, "clean", "quarkusBuild", "-Dquarkus.package.type=mutable-jar"); + BuildResult buildResult = runGradleWrapper(projectDir, "clean", "quarkusBuild", + "-Dquarkus.package.jar.type=mutable-jar"); assertThat(BuildResult.isSuccessful(buildResult.getTasks().get(":quarkusBuild"))).isTrue(); diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginFunctionalTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginFunctionalTest.java index 3cade3a2cc7203..fd1d98ca899293 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginFunctionalTest.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/QuarkusPluginFunctionalTest.java @@ -140,7 +140,7 @@ public void canDetectSystemPropertyChangeWhenBuilding() throws Exception { assertThat(BuildResult.isSuccessful(firstBuild.getTasks().get(":quarkusBuild"))).isTrue(); assertThat(projectRoot.toPath().resolve("build").resolve("quarkus-app").resolve("quarkus-run.jar")).exists(); - BuildResult secondBuild = runGradleWrapper(projectRoot, "quarkusBuild", "-Dquarkus.package.type=fast-jar"); + BuildResult secondBuild = runGradleWrapper(projectRoot, "quarkusBuild", "-Dquarkus.package.jar.type=fast-jar"); assertThat(BuildResult.isSuccessful(secondBuild.getTasks().get(":quarkusBuild"))).isTrue(); assertThat(projectRoot.toPath().resolve("build").resolve("quarkus-app")).exists(); diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/SystemPropsAsBuildTimeConfigSourceTest.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/SystemPropsAsBuildTimeConfigSourceTest.java index a526a346c65800..2a5d04c52b7d4f 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/SystemPropsAsBuildTimeConfigSourceTest.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/SystemPropsAsBuildTimeConfigSourceTest.java @@ -34,7 +34,7 @@ public void testBasicMultiModuleBuild() throws Exception { runGradleWrapper(projectDir, "-Dquarkus.example.name=cheburashka", "-Dquarkus.example.runtime-name=crocodile", - "-Dquarkus.package.type=mutable-jar", + "-Dquarkus.package.jar.type=mutable-jar", ":example-extension:example-extension-deployment:build", // this quarkusIntTest will make sure runtime config properties passed as env vars when launching the app are effective ":application:quarkusIntTest"); diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/BasicJavaNativeBuildIT.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/BasicJavaNativeBuildIT.java index cf7904ca9b6a02..ed700225f23970 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/BasicJavaNativeBuildIT.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/BasicJavaNativeBuildIT.java @@ -79,7 +79,7 @@ public void shouldBuildNativeImageWithCustomNameWithoutSuffix() throws Exception final File projectDir = getProjectDir("basic-java-native-module"); final BuildResult build = runGradleWrapper(projectDir, "clean", "buildNative", - "-Dquarkus.package.output-name=test", "-Dquarkus.package.add-runner-suffix=false"); + "-Dquarkus.package.output-name=test", "-Dquarkus.package.jar.add-runner-suffix=false"); assertThat(build.getTasks().get(":quarkusBuild")).isEqualTo(BuildResult.SUCCESS_OUTCOME); final String buildOutput = build.getOutput(); diff --git a/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/NativeIntegrationTestIT.java b/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/NativeIntegrationTestIT.java index 210d98b33678ac..e46129d966be59 100644 --- a/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/NativeIntegrationTestIT.java +++ b/integration-tests/gradle/src/test/java/io/quarkus/gradle/nativeimage/NativeIntegrationTestIT.java @@ -43,7 +43,7 @@ public void runNativeTestsWithoutRunnerSuffix() throws Exception { final File projectDir = getProjectDir("it-test-basic-project"); final BuildResult testResult = runGradleWrapper(projectDir, "clean", "testNative", - "-Dquarkus.package.add-runner-suffix=false"); + "-Dquarkus.package.jar.add-runner-suffix=false"); soft.assertThat(testResult.getTasks().get(":testNative")).isIn(BuildResult.SUCCESS_OUTCOME, BuildResult.FROM_CACHE); soft.assertThat(projectDir.toPath().resolve("build/code-with-quarkus-1.0.0-SNAPSHOT")).isRegularFile() .isExecutable(); diff --git a/integration-tests/hibernate-orm-compatibility-5.6/database-generator/pom.xml b/integration-tests/hibernate-orm-compatibility-5.6/database-generator/pom.xml index 57a97c01669516..099c1bbfdbdcad 100644 --- a/integration-tests/hibernate-orm-compatibility-5.6/database-generator/pom.xml +++ b/integration-tests/hibernate-orm-compatibility-5.6/database-generator/pom.xml @@ -114,7 +114,7 @@ false - native + true diff --git a/integration-tests/hibernate-orm-panache/src/test/java/DefaultPackageWithFastJarPMT.java b/integration-tests/hibernate-orm-panache/src/test/java/DefaultPackageWithFastJarPMT.java index 2c675ad226445b..d289e5a55c5590 100644 --- a/integration-tests/hibernate-orm-panache/src/test/java/DefaultPackageWithFastJarPMT.java +++ b/integration-tests/hibernate-orm-panache/src/test/java/DefaultPackageWithFastJarPMT.java @@ -18,7 +18,7 @@ public class DefaultPackageWithFastJarPMT { .setApplicationName("default-package") .setApplicationVersion(Version.getVersion()) .withConfigurationResource("application.properties") - .overrideConfigKey("quarkus.package.type", "fast-jar"); + .overrideConfigKey("quarkus.package.jar.type", "fast-jar"); @ProdBuildResults private ProdModeTestResults prodModeTestResults; diff --git a/integration-tests/hibernate-reactive-panache-kotlin/src/test/kotlin/DefaultPackageWithFastJarPMT.kt b/integration-tests/hibernate-reactive-panache-kotlin/src/test/kotlin/DefaultPackageWithFastJarPMT.kt index cab5c709ac8224..6b6475ab03834f 100644 --- a/integration-tests/hibernate-reactive-panache-kotlin/src/test/kotlin/DefaultPackageWithFastJarPMT.kt +++ b/integration-tests/hibernate-reactive-panache-kotlin/src/test/kotlin/DefaultPackageWithFastJarPMT.kt @@ -28,6 +28,6 @@ class DefaultPackageWithFastJarPMT { .setApplicationName("default-package") .setApplicationVersion(Version.getVersion()) .withConfigurationResource("application.properties") - .overrideConfigKey("quarkus.package.type", "fast-jar") + .overrideConfigKey("quarkus.package.jar.type", "fast-jar") } } diff --git a/integration-tests/hibernate-reactive-panache/src/test/java/DefaultPackageWithFastJarPMT.java b/integration-tests/hibernate-reactive-panache/src/test/java/DefaultPackageWithFastJarPMT.java index c122a485dc43c5..5bcb3bf5502a02 100644 --- a/integration-tests/hibernate-reactive-panache/src/test/java/DefaultPackageWithFastJarPMT.java +++ b/integration-tests/hibernate-reactive-panache/src/test/java/DefaultPackageWithFastJarPMT.java @@ -17,7 +17,7 @@ public class DefaultPackageWithFastJarPMT { .setApplicationName("default-package") .setApplicationVersion(Version.getVersion()) .withConfigurationResource("application.properties") - .overrideConfigKey("quarkus.package.type", "fast-jar"); + .overrideConfigKey("quarkus.package.jar.type", "fast-jar"); @ProdBuildResults private ProdModeTestResults prodModeTestResults; diff --git a/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/invoker.properties b/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/invoker.properties index ebd015390fe209..1c03c15f32e409 100644 --- a/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/invoker.properties +++ b/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enable=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/pom.xml b/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/pom.xml index e69aa83fb1c648..15703f69d052a4 100644 --- a/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/pom.xml +++ b/integration-tests/istio/maven-invoker-way/src/it/xds-grpc/pom.xml @@ -87,7 +87,7 @@ - native + true diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml b/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml index 8be32af85948a8..48df305cb1a8f9 100644 --- a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml +++ b/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml @@ -112,7 +112,7 @@ native - native + true diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties b/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties index 5c0db73f4dc1a2..178483d4627bc8 100644 --- a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties +++ b/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties @@ -4,4 +4,4 @@ greeting=bonjour quarkus.live-reload.password=secret quarkus.live-reload.url=http://localhost:8080 -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml b/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml index c28c5fbdc223f0..4ecdc8df91ce47 100644 --- a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml +++ b/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml @@ -129,7 +129,7 @@ native - native + true diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties b/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties index 5c0db73f4dc1a2..178483d4627bc8 100644 --- a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties +++ b/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties @@ -4,4 +4,4 @@ greeting=bonjour quarkus.live-reload.password=secret quarkus.live-reload.url=http://localhost:8080 -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar diff --git a/integration-tests/kubernetes-service-binding-jdbc/pom.xml b/integration-tests/kubernetes-service-binding-jdbc/pom.xml index bb1e2ceca9c5b2..0b80b18aa192f8 100644 --- a/integration-tests/kubernetes-service-binding-jdbc/pom.xml +++ b/integration-tests/kubernetes-service-binding-jdbc/pom.xml @@ -205,7 +205,7 @@ - native + true diff --git a/integration-tests/kubernetes-service-binding-reactive/pom.xml b/integration-tests/kubernetes-service-binding-reactive/pom.xml index acfc2c71483a0c..a715dc46915a44 100644 --- a/integration-tests/kubernetes-service-binding-reactive/pom.xml +++ b/integration-tests/kubernetes-service-binding-reactive/pom.xml @@ -207,7 +207,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml index 994a5b0bf40c60..5d640abc83b53c 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/knative-jib-build-and-deploy/pom.xml @@ -86,7 +86,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/invoker.properties index 007b9ba84e79a1..91098360de757a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/pom.xml index 062b4a22926fac..9654b7870cc901 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-deployment/pom.xml @@ -82,7 +82,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/invoker.properties index 604d355d772ef2..f02bbc5e0f8c2f 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} #invoker.goals=clean package -Dquarkus.kubernetes.deploy=true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/pom.xml index 85a32105b6f398..6dbbbe92131ea8 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-docker-build-and-deploy-statefulset/pom.xml @@ -82,7 +82,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/invoker.properties index ebd015390fe209..91098360de757a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/pom.xml index 8deeb81cc17dab..4042a973272e19 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-jib-build-and-deploy/pom.xml @@ -82,7 +82,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/invoker.properties index f0dfb6e6c40a12..6683ba8d48c2a0 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/invoker.properties @@ -1,2 +1,2 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true invoker.goals=clean package diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/pom.xml index 2992cab8252004..fb569b7d3ab5dc 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-existing-selectorless-manifest/pom.xml @@ -83,7 +83,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc-same-server/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc-same-server/pom.xml index 3f40176599cb7d..4cc5fd5b0aed5b 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc-same-server/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc-same-server/pom.xml @@ -84,7 +84,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc/pom.xml index 84f5e655cecc1a..ced0ce1223d236 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/kubernetes-with-grpc/pom.xml @@ -80,7 +80,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/invoker.properties index f0dfb6e6c40a12..6683ba8d48c2a0 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/invoker.properties @@ -1,2 +1,2 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true invoker.goals=clean package diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/pom.xml index d872aa6f1e691f..41e1b8a0b1b8b2 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/minikube-with-existing-manifest/pom.xml @@ -86,7 +86,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/invoker.properties index ebd015390fe209..91098360de757a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/pom.xml index d59a6faae85457..74d9c3ea5dc63a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy-deploymentconfig/pom.xml @@ -82,7 +82,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/invoker.properties index ebd015390fe209..91098360de757a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/pom.xml index b7aefdbd26b73d..7c4a0f7543cb3e 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-docker-build-and-deploy/pom.xml @@ -82,7 +82,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/invoker.properties b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/invoker.properties index ebd015390fe209..91098360de757a 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/invoker.properties +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/invoker.properties @@ -1,4 +1,4 @@ -# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.package.type=native +# invoker.goals=clean package -Dquarkus.container.build=true -Dquarkus.native.enabled=true # ensure that an attempt to deploy is made, but that the attempt fails (as we don't want to deploy this test application to a cluster that the runner of test may have configured) invoker.goals=clean package -Dquarkus.kubernetes.deploy=true ${kubernetes-client-api-server-url} # expect a failure since there is no Kubernetes cluster to deploy to diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/pom.xml index 4353d27d06eab7..d07ad093611c51 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-s2i-build-and-deploy/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-with-output-directory-build-and-deploy/pom.xml b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-with-output-directory-build-and-deploy/pom.xml index c191bcdacf8dcd..68cb4b4e4a109b 100644 --- a/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-with-output-directory-build-and-deploy/pom.xml +++ b/integration-tests/kubernetes/maven-invoker-way/src/it/openshift-with-output-directory-build-and-deploy/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/openshift-with-uberjar.properties b/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/openshift-with-uberjar.properties index f956e2c95be36e..506a1f4a2c9d9c 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/openshift-with-uberjar.properties +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/openshift-with-uberjar.properties @@ -1,2 +1,2 @@ quarkus.kubernetes.deployment-target=openshift -quarkus.package.type=uber-jar \ No newline at end of file +quarkus.package.jar.type=uber-jar \ No newline at end of file diff --git a/integration-tests/main/pom.xml b/integration-tests/main/pom.xml index 152e4f371975d5..2cee35253dd057 100644 --- a/integration-tests/main/pom.xml +++ b/integration-tests/main/pom.xml @@ -599,7 +599,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/maven/src/test/java/io/quarkus/maven/it/JarRunnerIT.java b/integration-tests/maven/src/test/java/io/quarkus/maven/it/JarRunnerIT.java index e33c7408d5c573..d0f34c1a5dfa92 100644 --- a/integration-tests/maven/src/test/java/io/quarkus/maven/it/JarRunnerIT.java +++ b/integration-tests/maven/src/test/java/io/quarkus/maven/it/JarRunnerIT.java @@ -211,7 +211,7 @@ public void testThatLegacyJarFormatWorks() throws Exception { MavenProcessInvocationResult result = running .execute(Arrays.asList("package", "-DskipTests", - "-Dquarkus.package.type=legacy-jar"), Collections.emptyMap()); + "-Dquarkus.package.jar.type=legacy-jar"), Collections.emptyMap()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) .until(() -> result.getProcess() != null && !result.getProcess().isAlive()); @@ -274,7 +274,7 @@ public void reaugmentationWithRemovedArtifacts() throws Exception { // The default build MavenProcessInvocationResult result = running - .execute(List.of("package", "-DskipTests", "-Dquarkus.package.type=mutable-jar", + .execute(List.of("package", "-DskipTests", "-Dquarkus.package.jar.type=mutable-jar", "-Dquarkus.analytics.disabled=true"), Map.of()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) .until(() -> result.getProcess() != null && !result.getProcess().isAlive()); @@ -369,7 +369,7 @@ public void reaugmentationWithRemovedArtifactsUsingSystemProperties() throws Exc // The default build MavenProcessInvocationResult result = running - .execute(List.of("package", "-DskipTests", "-Dquarkus.package.type=mutable-jar"), Map.of()); + .execute(List.of("package", "-DskipTests", "-Dquarkus.package.jar.type=mutable-jar"), Map.of()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) .until(() -> result.getProcess() != null && !result.getProcess().isAlive()); assertThat(running.log()).containsIgnoringCase("BUILD SUCCESS"); @@ -481,8 +481,8 @@ private void assertThatMutableFastJarWorks(String targetDirSuffix, String provid RunningInvoker running = new RunningInvoker(testDir, false); MavenProcessInvocationResult result = running - .execute(Arrays.asList("package", "-DskipTests", "-Dquarkus.package.type=mutable-jar", - "-Dquarkus.package.user-providers-directory=" + providersDir), Collections.emptyMap()); + .execute(Arrays.asList("package", "-DskipTests", "-Dquarkus.package.jar.type=mutable-jar", + "-Dquarkus.package.jar.user-providers-directory=" + providersDir), Collections.emptyMap()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) .until(() -> result.getProcess() != null && !result.getProcess().isAlive()); @@ -613,7 +613,7 @@ public void testThatAppCDSAreUsable() throws Exception { RunningInvoker running = new RunningInvoker(testDir, false); MavenProcessInvocationResult result = running - .execute(Arrays.asList("package", "-DskipTests", "-Dquarkus.package.create-appcds=true"), + .execute(Arrays.asList("package", "-DskipTests", "-Dquarkus.package.jar.create-appcds=true"), Collections.emptyMap()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) @@ -817,7 +817,7 @@ private void assertThatFastJarFormatWorks(String outputDir) throws Exception { MavenProcessInvocationResult result = running .execute(Arrays.asList("package", "-DskipTests", - "-Dquarkus.package.type=fast-jar", + "-Dquarkus.package.jar.type=fast-jar", outputDir == null ? "" : "-Dquarkus.package.output-directory=" + outputDir), Collections.emptyMap()); await().atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) diff --git a/integration-tests/maven/src/test/java/io/quarkus/maven/it/PackageIT.java b/integration-tests/maven/src/test/java/io/quarkus/maven/it/PackageIT.java index 8cc157a1668f82..d72c77de82d533 100644 --- a/integration-tests/maven/src/test/java/io/quarkus/maven/it/PackageIT.java +++ b/integration-tests/maven/src/test/java/io/quarkus/maven/it/PackageIT.java @@ -67,9 +67,10 @@ public void testConfigTracking() throws Exception { assertThat(name).doesNotStartWith("quarkus.test."); } - result = running.execute(List.of("package -DskipTests -Dquarkus.package.type=uber-jar"), Map.of()); + result = running.execute(List.of("package -DskipTests -Dquarkus.package.jar.type=uber-jar"), Map.of()); assertThat(result.getProcess().waitFor()).isEqualTo(0); - assertThat(running.log()).contains("Option quarkus.package.type has changed since the last build from jar to uber-jar"); + assertThat(running.log()) + .contains("Option quarkus.package.jar.type has changed since the last build from jar to uber-jar"); } @Test @@ -183,7 +184,7 @@ public void testPackageWorksWhenUberjarIsTrue() private void createAndVerifyUberJar() throws IOException, MavenInvocationException, InterruptedException { Properties p = new Properties(); - p.setProperty("quarkus.package.type", "uber-jar"); + p.setProperty("quarkus.package.jar.type", "uber-jar"); running = new RunningInvoker(testDir, false); final MavenProcessInvocationResult result = running.execute(List.of("package"), @@ -219,8 +220,8 @@ public void testUberJarWithoutRunnerSuffix() testDir = initProject("projects/uberjar-check", "projects/uberjar-runner-suffix-off"); Properties p = new Properties(); - p.setProperty("quarkus.package.type", "uber-jar"); - p.setProperty("quarkus.package.add-runner-suffix", "false"); + p.setProperty("quarkus.package.jar.type", "uber-jar"); + p.setProperty("quarkus.package.jar.add-runner-suffix", "false"); running = new RunningInvoker(testDir, false); final MavenProcessInvocationResult result = running.execute(List.of("-DskipTests", "package"), @@ -281,7 +282,7 @@ public void testRunnerUberJarHasValidCRC() throws Exception { running = new RunningInvoker(testDir, false); Properties p = new Properties(); - p.setProperty("quarkus.package.type", "uber-jar"); + p.setProperty("quarkus.package.jar.type", "uber-jar"); final MavenProcessInvocationResult result = running.execute(Collections.singletonList("package"), Collections.emptyMap(), p); assertThat(result.getProcess().waitFor()).isEqualTo(0); @@ -390,7 +391,7 @@ public void testNativeSourcesPackage() throws Exception { running = new RunningInvoker(testDir, false); final MavenProcessInvocationResult result = running.execute( - Arrays.asList("package", "-Dquarkus.package.type=native-sources"), + Arrays.asList("package", "-Dquarkus.native.enabled=true", "-Dquarkus.native.sources-only=true"), Collections.emptyMap()); assertThat(result.getProcess().waitFor()).isEqualTo(0); diff --git a/integration-tests/maven/src/test/resources-filtered/expected/create-extension-pom-itest/integration-tests/itest/pom.xml b/integration-tests/maven/src/test/resources-filtered/expected/create-extension-pom-itest/integration-tests/itest/pom.xml index 1d673c7fd45033..f9089bb6e404f3 100644 --- a/integration-tests/maven/src/test/resources-filtered/expected/create-extension-pom-itest/integration-tests/itest/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/expected/create-extension-pom-itest/integration-tests/itest/pom.xml @@ -65,7 +65,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/pom.xml index 45c9cd0ea1b35e..d1d8df18820291 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/pom.xml @@ -95,7 +95,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processors/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processors/pom.xml index b03e20995e52ac..6204f590a11d88 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processors/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processors/pom.xml @@ -100,7 +100,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-classpath/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-classpath/pom.xml index 521ff61c3a10ad..2b8eed57eb3922 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/apt-in-classpath/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/apt-in-classpath/pom.xml @@ -100,7 +100,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/arc-exclude-dependencies/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/arc-exclude-dependencies/runner/pom.xml index 09cd22b35398ad..f93f0f0bef0398 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/arc-exclude-dependencies/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/arc-exclude-dependencies/runner/pom.xml @@ -69,7 +69,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/basic-command-mode/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/basic-command-mode/pom.xml index 34787b9b87cc5f..12e33313078c34 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/basic-command-mode/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/basic-command-mode/pom.xml @@ -92,7 +92,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/capabilities-conflict/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/capabilities-conflict/runner/pom.xml index a3a770674f791f..43e4ef60ca0326 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/capabilities-conflict/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/capabilities-conflict/runner/pom.xml @@ -73,7 +73,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/capabilities-missing/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/capabilities-missing/runner/pom.xml index 7cb65524c3b20c..35d5bd840b1993 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/capabilities-missing/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/capabilities-missing/runner/pom.xml @@ -70,7 +70,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-2.x/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-2.x/pom.xml index e9eda31abf9922..1487f328bb8052 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-2.x/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-2.x/pom.xml @@ -90,7 +90,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-inst/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-inst/pom.xml index 9f2edd4e46ed9e..96b2e6962f21a0 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-inst/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-inst/pom.xml @@ -83,7 +83,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-build/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-build/pom.xml index 9ca9fd29ad3f04..56646810b0c8ef 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-build/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-build/pom.xml @@ -65,7 +65,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-generate/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-generate/pom.xml index 545a6ecee847d6..cc12bca007cc77 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-generate/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-generate/pom.xml @@ -82,7 +82,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-undertow/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-undertow/pom.xml index 34a6ed46068ab0..251df3d43a3052 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-no-undertow/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-no-undertow/pom.xml @@ -66,7 +66,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-noconfig/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-noconfig/pom.xml index 43f7bc5aff4e04..cd31ef445aade3 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-noconfig/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-noconfig/pom.xml @@ -76,7 +76,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/pom.xml index f43def6d5eaaed..55b1c4bb5fa1c4 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/pom.xml @@ -77,7 +77,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/src/main/resources/application.properties index a75dd8d91b8649..3f224b52e686b6 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-remote-dev/src/main/resources/application.properties @@ -3,7 +3,7 @@ key=value greeting=bonjour quarkus.live-reload.url=http://localhost:8080/ quarkus.live-reload.password=secret -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar quarkus.log.level=INFO quarkus.log.file.enable=false quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic-resource-filtering/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic-resource-filtering/pom.xml index 8de0b59f56073f..55d05dd07cb4ea 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic-resource-filtering/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic-resource-filtering/pom.xml @@ -83,7 +83,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classic/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classic/pom.xml index 4b61b466dfe8ee..6e8f3dfe1026fa 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classic/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classic/pom.xml @@ -95,7 +95,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/classloader-linkage-error/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/classloader-linkage-error/pom.xml index c52587a1d97da9..3289a1d3020c37 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/classloader-linkage-error/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/classloader-linkage-error/pom.xml @@ -78,7 +78,7 @@ legacy - legacy-jar + legacy-jar legacy-quarkus-app @@ -93,7 +93,7 @@ uber - uber-jar + uber-jar uber-quarkus-app diff --git a/integration-tests/maven/src/test/resources-filtered/projects/codegen-config-factory/app/src/main/docker/Dockerfile.legacy-jar b/integration-tests/maven/src/test/resources-filtered/projects/codegen-config-factory/app/src/main/docker/Dockerfile.legacy-jar index 95ce7681973c55..6a122cc51dfe54 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/codegen-config-factory/app/src/main/docker/Dockerfile.legacy-jar +++ b/integration-tests/maven/src/test/resources-filtered/projects/codegen-config-factory/app/src/main/docker/Dockerfile.legacy-jar @@ -3,7 +3,7 @@ # # Before building the container image run: # -# ./mvnw package -Dquarkus.package.type=legacy-jar +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar # # Then, build the image with: # diff --git a/integration-tests/maven/src/test/resources-filtered/projects/command-mode-app-args-plugin-config/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/command-mode-app-args-plugin-config/pom.xml index 9621f03c8f1d06..cce802fc99302f 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/command-mode-app-args-plugin-config/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/command-mode-app-args-plugin-config/pom.xml @@ -14,7 +14,7 @@ ${maven.compiler.source} ${maven.compiler.target} UTF-8 - uber-jar + uber-jar @@ -96,7 +96,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/conditional-dependencies/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/conditional-dependencies/runner/pom.xml index 95fe2c46fa3a8e..25b4481266a056 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/conditional-dependencies/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/conditional-dependencies/runner/pom.xml @@ -79,7 +79,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/custom-manifest-attributes/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/custom-manifest-attributes/src/main/resources/application.properties index a030ad3c354cd4..eaece2b32fb098 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/custom-manifest-attributes/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/custom-manifest-attributes/src/main/resources/application.properties @@ -1,4 +1,4 @@ # Configuration file -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar greeting=hi diff --git a/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/pom.xml index d2569a9a2ed295..f85199513adf9b 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/pom.xml @@ -76,7 +76,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/src/main/resources/application.properties index ad54b1b7740c6a..38c550555f88f2 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/dependency-on-pom/src/main/resources/application.properties @@ -1,3 +1,3 @@ # Configuration file -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar quarkus.live-reload.password=secret diff --git a/integration-tests/maven/src/test/resources-filtered/projects/extension-test-with-no-main/integration-tests/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/extension-test-with-no-main/integration-tests/pom.xml index 8e400633eec0b9..0455fb80de0280 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/extension-test-with-no-main/integration-tests/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/extension-test-with-no-main/integration-tests/pom.xml @@ -86,7 +86,7 @@ false - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/ignore-entries-uber-jar/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/ignore-entries-uber-jar/pom.xml index f3753c24ee2796..5fbf2395421460 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/ignore-entries-uber-jar/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/ignore-entries-uber-jar/pom.xml @@ -14,7 +14,7 @@ ${maven.compiler.source} ${maven.compiler.target} UTF-8 - uber-jar + uber-jar diff --git a/integration-tests/maven/src/test/resources-filtered/projects/modules-in-profiles/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/modules-in-profiles/runner/pom.xml index d9d24b35f2326a..913c8aab8f0b17 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/modules-in-profiles/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/modules-in-profiles/runner/pom.xml @@ -45,7 +45,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multi-build-mode/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multi-build-mode/pom.xml index aa1aa8f313096e..5e2ec6013f8aa6 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multi-build-mode/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multi-build-mode/pom.xml @@ -87,7 +87,7 @@ fast-foo-quarkus-app true - org.apache.commons:commons-collections4::jar + org.apache.commons:commons-collections4::jar foo @@ -105,7 +105,7 @@ fast-bar-quarkus-app true - commons-io:commons-io:: + commons-io:commons-io:: bar @@ -123,7 +123,7 @@ fast-foo-full-quarkus-app true - org.apache.commons:commons-collections4::jar,commons-io:commons-io:: + org.apache.commons:commons-collections4::jar,commons-io:commons-io:: foo @@ -157,10 +157,10 @@ legacy - legacy-jar + legacy-jar legacy-foo-quarkus-app true - org.apache.commons:commons-collections4::jar + org.apache.commons:commons-collections4::jar foo @@ -177,10 +177,10 @@ legacy - legacy-jar + legacy-jar legacy-bar-quarkus-app true - commons-io:commons-io:: + commons-io:commons-io:: bar @@ -197,10 +197,10 @@ legacy - legacy-jar + legacy-jar legacy-foo-full-quarkus-app true - org.apache.commons:commons-collections4::jar,commons-io:commons-io:: + org.apache.commons:commons-collections4::jar,commons-io:commons-io:: foo @@ -217,7 +217,7 @@ legacy - legacy-jar + legacy-jar legacy-bar-empty-quarkus-app true @@ -236,10 +236,10 @@ uber - uber-jar + uber-jar uber-foo-quarkus-app true - org.apache.commons:commons-collections4::jar + org.apache.commons:commons-collections4::jar foo @@ -256,10 +256,10 @@ uber - uber-jar + uber-jar uber-bar-quarkus-app true - commons-io:commons-io:: + commons-io:commons-io:: bar @@ -276,10 +276,10 @@ uber - uber-jar + uber-jar uber-foo-full-quarkus-app true - org.apache.commons:commons-collections4::jar,commons-io:commons-io:: + org.apache.commons:commons-collections4::jar,commons-io:commons-io:: foo @@ -296,7 +296,7 @@ uber - uber-jar + uber-jar uber-bar-empty-quarkus-app true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/pom.xml index 4909eb6bf86015..24d797080cb139 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multijar-module/runner/pom.xml @@ -94,7 +94,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-classpath/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-classpath/runner/pom.xml index bedf6a8862a048..02fc7c14100815 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-classpath/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-classpath/runner/pom.xml @@ -72,7 +72,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-revision-prop/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-revision-prop/runner/pom.xml index ea1e9e963dde8d..932e52b29bdbdc 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-revision-prop/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-revision-prop/runner/pom.xml @@ -71,7 +71,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-root-no-src/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-root-no-src/runner/pom.xml index 7c1892834041b1..619aefc6fd99d9 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multimodule-root-no-src/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multimodule-root-no-src/runner/pom.xml @@ -73,7 +73,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/pom.xml index 7c1892834041b1..619aefc6fd99d9 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/multimodule/runner/pom.xml @@ -73,7 +73,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/native-image-app/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/native-image-app/pom.xml index 17d393642168a7..7e8892cc066de6 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/native-image-app/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/native-image-app/pom.xml @@ -67,7 +67,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/no-resource-root/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/no-resource-root/pom.xml index 8ce103f004be9d..fd0f8375667a8b 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/no-resource-root/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/no-resource-root/pom.xml @@ -65,7 +65,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/platform-properties-overrides/app/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/platform-properties-overrides/app/pom.xml index 77c5e0d6ac905a..04872168ede509 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/platform-properties-overrides/app/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/platform-properties-overrides/app/pom.xml @@ -94,7 +94,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/project-with-extension/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/project-with-extension/runner/pom.xml index 88aa950276fca7..fb6ae6cde6dcd6 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/project-with-extension/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/project-with-extension/runner/pom.xml @@ -77,7 +77,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/property-expansion/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/property-expansion/pom.xml index 4639f3f8251775..7e80f2c20470ec 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/property-expansion/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/property-expansion/pom.xml @@ -106,7 +106,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/property-overrides/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/property-overrides/runner/pom.xml index a2e44abfb15fbd..b8efc1174f1f7b 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/property-overrides/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/property-overrides/runner/pom.xml @@ -78,7 +78,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/proto-gen/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/proto-gen/pom.xml index 776edca2175e55..605fa3d1011387 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/proto-gen/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/proto-gen/pom.xml @@ -79,7 +79,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies-groupid/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies-groupid/runner/pom.xml index 5117f1abe931ef..155f49008ce7ea 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies-groupid/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies-groupid/runner/pom.xml @@ -69,7 +69,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies/runner/pom.xml index 5117f1abe931ef..155f49008ce7ea 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/quarkus-index-dependencies/runner/pom.xml @@ -69,7 +69,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/quarkus.package.output-directory/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/quarkus.package.output-directory/pom.xml index 297dc0bbd02314..ab765e2b640800 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/quarkus.package.output-directory/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/quarkus.package.output-directory/pom.xml @@ -86,7 +86,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/reactive-routes/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/reactive-routes/pom.xml index 652088c9531622..973db66b1ece6c 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/reactive-routes/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/reactive-routes/pom.xml @@ -103,7 +103,7 @@ - jar + fast-jar @@ -137,7 +137,7 @@ - legacy-jar + legacy-jar @@ -171,7 +171,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/maven/src/test/resources-filtered/projects/rest-client-custom-headers-extension/runner/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/rest-client-custom-headers-extension/runner/pom.xml index 6696191370914d..973182ca31c489 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/rest-client-custom-headers-extension/runner/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/rest-client-custom-headers-extension/runner/pom.xml @@ -69,7 +69,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/rr-with-json-logging/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/rr-with-json-logging/pom.xml index 1ef38d674ebe8d..cb1b31e8183b49 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/rr-with-json-logging/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/rr-with-json-logging/pom.xml @@ -93,7 +93,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/test-module-dependency/app/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/test-module-dependency/app/pom.xml index 51853d67f30410..4f8cf9794dd66f 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/test-module-dependency/app/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/test-module-dependency/app/pom.xml @@ -87,7 +87,7 @@ - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/pom.xml index f40e329c733b46..2e33bfb998c5fc 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/pom.xml @@ -81,7 +81,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/src/main/resources/application.properties b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/src/main/resources/application.properties index 6dbd12e4627c56..e68453a1104820 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/src/main/resources/application.properties +++ b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-check/src/main/resources/application.properties @@ -1,4 +1,4 @@ # Configuration file key = value greeting=bonjour -quarkus.package.type=jar +quarkus.package.jar.type=fast-jar diff --git a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-maven-plugin-config/pom.xml b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-maven-plugin-config/pom.xml index 68c39b0e932fdb..db5028c50e482f 100644 --- a/integration-tests/maven/src/test/resources-filtered/projects/uberjar-maven-plugin-config/pom.xml +++ b/integration-tests/maven/src/test/resources-filtered/projects/uberjar-maven-plugin-config/pom.xml @@ -14,7 +14,7 @@ ${maven.compiler.source} ${maven.compiler.target} UTF-8 - uber-jar + uber-jar @@ -81,7 +81,7 @@ native - native + true diff --git a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_integration-tests_pom.xml b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_integration-tests_pom.xml index 6351615f20ec49..a555cd4da0a9c2 100644 --- a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_integration-tests_pom.xml +++ b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_integration-tests_pom.xml @@ -91,7 +91,7 @@ false - native + true diff --git a/integration-tests/mongodb-rest-data-panache/pom.xml b/integration-tests/mongodb-rest-data-panache/pom.xml index fd662b60da6444..ec4999a8ce0ea7 100644 --- a/integration-tests/mongodb-rest-data-panache/pom.xml +++ b/integration-tests/mongodb-rest-data-panache/pom.xml @@ -151,7 +151,7 @@ - native + true diff --git a/integration-tests/mtls-certificates/pom.xml b/integration-tests/mtls-certificates/pom.xml index 59c232f7399bcb..51e34e12c86ec2 100644 --- a/integration-tests/mtls-certificates/pom.xml +++ b/integration-tests/mtls-certificates/pom.xml @@ -110,7 +110,7 @@ - native + true diff --git a/integration-tests/openapi/pom.xml b/integration-tests/openapi/pom.xml index 00f3537967209b..6f8a6b62503546 100644 --- a/integration-tests/openapi/pom.xml +++ b/integration-tests/openapi/pom.xml @@ -162,7 +162,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/opentelemetry-grpc/pom.xml b/integration-tests/opentelemetry-grpc/pom.xml index 291ede3694acda..6a6bf38f405315 100644 --- a/integration-tests/opentelemetry-grpc/pom.xml +++ b/integration-tests/opentelemetry-grpc/pom.xml @@ -140,7 +140,7 @@ - native + true diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml b/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml index 0eeb5d5ab41fba..6fbe77dbd028d5 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml +++ b/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml @@ -256,7 +256,7 @@ - native + true diff --git a/integration-tests/opentelemetry-quickstart/pom.xml b/integration-tests/opentelemetry-quickstart/pom.xml index ff8fd4cc334253..6258f7c3e68a4c 100644 --- a/integration-tests/opentelemetry-quickstart/pom.xml +++ b/integration-tests/opentelemetry-quickstart/pom.xml @@ -146,7 +146,7 @@ - native + true diff --git a/integration-tests/opentelemetry-reactive-messaging/pom.xml b/integration-tests/opentelemetry-reactive-messaging/pom.xml index bbe33f7c0078fb..db75fbb7491f66 100644 --- a/integration-tests/opentelemetry-reactive-messaging/pom.xml +++ b/integration-tests/opentelemetry-reactive-messaging/pom.xml @@ -158,7 +158,7 @@ - native + true diff --git a/integration-tests/opentelemetry-reactive/pom.xml b/integration-tests/opentelemetry-reactive/pom.xml index fea156ac737de9..660dd8da737d17 100644 --- a/integration-tests/opentelemetry-reactive/pom.xml +++ b/integration-tests/opentelemetry-reactive/pom.xml @@ -168,7 +168,7 @@ - native + true diff --git a/integration-tests/opentelemetry-spi/pom.xml b/integration-tests/opentelemetry-spi/pom.xml index 6ef06b3f8a5710..10629ac68f43c2 100644 --- a/integration-tests/opentelemetry-spi/pom.xml +++ b/integration-tests/opentelemetry-spi/pom.xml @@ -132,7 +132,7 @@ - native + true diff --git a/integration-tests/opentelemetry-vertx/pom.xml b/integration-tests/opentelemetry-vertx/pom.xml index 762d2227ba8ec0..f6c24ef4e5361e 100644 --- a/integration-tests/opentelemetry-vertx/pom.xml +++ b/integration-tests/opentelemetry-vertx/pom.xml @@ -176,7 +176,7 @@ - native + true diff --git a/integration-tests/opentelemetry/pom.xml b/integration-tests/opentelemetry/pom.xml index 0eab55f324870b..903728882aee07 100644 --- a/integration-tests/opentelemetry/pom.xml +++ b/integration-tests/opentelemetry/pom.xml @@ -178,7 +178,7 @@ - native + true diff --git a/integration-tests/packaging/src/test/java/io/quarkus/removedclasses/AbstractRemovedResourceTest.java b/integration-tests/packaging/src/test/java/io/quarkus/removedclasses/AbstractRemovedResourceTest.java index 20e127bd0faafa..e96ecfac78c2b4 100644 --- a/integration-tests/packaging/src/test/java/io/quarkus/removedclasses/AbstractRemovedResourceTest.java +++ b/integration-tests/packaging/src/test/java/io/quarkus/removedclasses/AbstractRemovedResourceTest.java @@ -15,7 +15,7 @@ protected static QuarkusProdModeTest application(String packageType) { .add(new StringAsset( "quarkus.class-loading.removed-resources.\"io.quarkus\\:quarkus-integration-test-shared-library\"=io/quarkus/it/shared/RemovedResource.class\n" + - "quarkus.package.type=" + packageType), + "quarkus.package.jar.type=" + packageType), "application.properties")) .setApplicationName("no-paging-test") .setApplicationVersion(Version.getVersion()) diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-thin.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-thin.properties index c0431961cac63f..4f338b25207ff2 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-thin.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-thin.properties @@ -1,2 +1,2 @@ -quarkus.package.type=jar -quarkus.package.manifest.attributes."Built-By"=Quarkus Plugin \ No newline at end of file +quarkus.package.jar.type=fast-jar +quarkus.package.jar.manifest.attributes."Built-By"=Quarkus Plugin \ No newline at end of file diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-uber.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-uber.properties index e8b4792e6615ff..f8d99a07867028 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-uber.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-entries-uber.properties @@ -1,2 +1,2 @@ -quarkus.package.type=uber-jar -quarkus.package.manifest.attributes."Built-By"=Quarkus Plugin \ No newline at end of file +quarkus.package.jar.type=uber-jar +quarkus.package.jar.manifest.attributes."Built-By"=Quarkus Plugin \ No newline at end of file diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-thin.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-thin.properties index bea0f3ae8b072a..90763d625512e0 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-thin.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-thin.properties @@ -1,3 +1,3 @@ -quarkus.package.type=jar -quarkus.package.manifest.manifest-sections.Test-Information.Test-Key-1=Test Value 1 -quarkus.package.manifest.manifest-sections.Test-Information.Test-Key-2=Test Value 2 \ No newline at end of file +quarkus.package.jar.type=fast-jar +quarkus.package.jar.manifest.manifest-sections.Test-Information.Test-Key-1=Test Value 1 +quarkus.package.jar.manifest.manifest-sections.Test-Information.Test-Key-2=Test Value 2 \ No newline at end of file diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-uber.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-uber.properties index 8c07aed4295a0b..6f251a9ea14ba9 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-uber.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/custom-manifest-uber.properties @@ -1,3 +1,3 @@ -quarkus.package.type=uber-jar -quarkus.package.manifest.manifest-sections.Test-Information.Test-Key-1=Test Value 1 -quarkus.package.manifest.manifest-sections.Test-Information.Test-Key-2=Test Value 2 \ No newline at end of file +quarkus.package.jar.type=uber-jar +quarkus.package.jar.manifest.manifest-sections.Test-Information.Test-Key-1=Test Value 1 +quarkus.package.jar.manifest.manifest-sections.Test-Information.Test-Key-2=Test Value 2 \ No newline at end of file diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-thin.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-thin.properties index a615e1959f6bed..334b04498af1cb 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-thin.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-thin.properties @@ -1 +1 @@ -quarkus.package.type=jar +quarkus.package.jar.type=fast-jar diff --git a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-uber.properties b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-uber.properties index 389ff30544c777..1ea43be710b068 100644 --- a/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-uber.properties +++ b/integration-tests/packaging/src/test/resources/projects/custom-manifest-section/no-custom-manifest-uber.properties @@ -1 +1 @@ -quarkus.package.type=uber-jar +quarkus.package.jar.type=uber-jar diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index aae28b9a8ad881..22ee5f313829e2 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -413,7 +413,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive-http2/pom.xml b/integration-tests/rest-client-reactive-http2/pom.xml index 1fbe3216a4fd20..74c256e26dcfbb 100644 --- a/integration-tests/rest-client-reactive-http2/pom.xml +++ b/integration-tests/rest-client-reactive-http2/pom.xml @@ -98,7 +98,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive-kotlin-serialization-with-validator/pom.xml b/integration-tests/rest-client-reactive-kotlin-serialization-with-validator/pom.xml index b3dda26c909262..bb2bf24bc2f16c 100644 --- a/integration-tests/rest-client-reactive-kotlin-serialization-with-validator/pom.xml +++ b/integration-tests/rest-client-reactive-kotlin-serialization-with-validator/pom.xml @@ -163,7 +163,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive-kotlin-serialization/pom.xml b/integration-tests/rest-client-reactive-kotlin-serialization/pom.xml index ccc0f2168807a0..9e64aae9e61ecb 100644 --- a/integration-tests/rest-client-reactive-kotlin-serialization/pom.xml +++ b/integration-tests/rest-client-reactive-kotlin-serialization/pom.xml @@ -146,7 +146,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive-multipart/pom.xml b/integration-tests/rest-client-reactive-multipart/pom.xml index 479914861669f6..00cce97b481622 100644 --- a/integration-tests/rest-client-reactive-multipart/pom.xml +++ b/integration-tests/rest-client-reactive-multipart/pom.xml @@ -99,7 +99,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive-stork/pom.xml b/integration-tests/rest-client-reactive-stork/pom.xml index db147d4643c639..3bf27a3e6dc9bb 100644 --- a/integration-tests/rest-client-reactive-stork/pom.xml +++ b/integration-tests/rest-client-reactive-stork/pom.xml @@ -144,7 +144,7 @@ - native + true diff --git a/integration-tests/rest-client-reactive/pom.xml b/integration-tests/rest-client-reactive/pom.xml index 44bdcf799ccf52..8d2eeded7d8d03 100644 --- a/integration-tests/rest-client-reactive/pom.xml +++ b/integration-tests/rest-client-reactive/pom.xml @@ -213,7 +213,7 @@ - native + true diff --git a/integration-tests/scala/src/test/resources/projects/classic-scala/pom.xml b/integration-tests/scala/src/test/resources/projects/classic-scala/pom.xml index ee6ed9e3dc3404..4839d506ea3070 100644 --- a/integration-tests/scala/src/test/resources/projects/classic-scala/pom.xml +++ b/integration-tests/scala/src/test/resources/projects/classic-scala/pom.xml @@ -117,7 +117,7 @@ native - native + true diff --git a/integration-tests/scala/src/test/resources/projects/classic-scala/src/main/resources/application.properties b/integration-tests/scala/src/test/resources/projects/classic-scala/src/main/resources/application.properties index 5c0db73f4dc1a2..178483d4627bc8 100644 --- a/integration-tests/scala/src/test/resources/projects/classic-scala/src/main/resources/application.properties +++ b/integration-tests/scala/src/test/resources/projects/classic-scala/src/main/resources/application.properties @@ -4,4 +4,4 @@ greeting=bonjour quarkus.live-reload.password=secret quarkus.live-reload.url=http://localhost:8080 -quarkus.package.type=mutable-jar +quarkus.package.jar.type=mutable-jar diff --git a/integration-tests/smallrye-metrics/pom.xml b/integration-tests/smallrye-metrics/pom.xml index e41a1e5c5eeebd..501976d466147d 100644 --- a/integration-tests/smallrye-metrics/pom.xml +++ b/integration-tests/smallrye-metrics/pom.xml @@ -130,7 +130,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/smallrye-stork-registration/pom.xml b/integration-tests/smallrye-stork-registration/pom.xml index a7b18efc7b8150..3986cd800e0d04 100644 --- a/integration-tests/smallrye-stork-registration/pom.xml +++ b/integration-tests/smallrye-stork-registration/pom.xml @@ -124,7 +124,7 @@ - native + true diff --git a/integration-tests/spring-data-jpa/src/main/resources/application.properties b/integration-tests/spring-data-jpa/src/main/resources/application.properties index 9953061a83078c..a4cde9e7582bb3 100644 --- a/integration-tests/spring-data-jpa/src/main/resources/application.properties +++ b/integration-tests/spring-data-jpa/src/main/resources/application.properties @@ -1,4 +1,4 @@ -quarkus.package.type=fast-jar +quarkus.package.jar.type=fast-jar quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 diff --git a/integration-tests/test-extension/extension/deployment/src/main/java/io/quarkus/extest/deployment/UberJarConfigBuildStep.java b/integration-tests/test-extension/extension/deployment/src/main/java/io/quarkus/extest/deployment/UberJarConfigBuildStep.java index 6f0a1e1b9c263e..217eec520addee 100644 --- a/integration-tests/test-extension/extension/deployment/src/main/java/io/quarkus/extest/deployment/UberJarConfigBuildStep.java +++ b/integration-tests/test-extension/extension/deployment/src/main/java/io/quarkus/extest/deployment/UberJarConfigBuildStep.java @@ -1,5 +1,7 @@ package io.quarkus.extest.deployment; +import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*; + import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -33,7 +35,7 @@ UberJarMergedResourceBuildItem uberJarMergedResourceBuildItem() { @BuildStep void uberJarMergedResourceBuildItem(BuildProducer generatedResourcesProducer, PackageConfig packageConfig) { - if (packageConfig.isUberJar()) { + if (packageConfig.jar().type() == UBER_JAR) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { XmlCombiner combiner = new XmlCombiner(); diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java index cec5aa67d474a7..4a2ff352966e7e 100644 --- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java +++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java @@ -29,7 +29,7 @@ class GeneratedResourceBuildItemTest { .setApplicationVersion("0.1-SNAPSHOT") .setRun(true) .setExpectExit(true) - .overrideConfigKey("quarkus.package.type", "uber-jar") + .overrideConfigKey("quarkus.package.jar.type", "uber-jar") .setForcedDependencies(List.of( Dependency.of("org.apache.cxf", "cxf-rt-bindings-xml", "3.4.3"), Dependency.of("org.apache.cxf", "cxf-rt-bindings-soap", "3.4.3"))); diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarIgnoredResourceBuildItemTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarIgnoredResourceBuildItemTest.java index 55889ee65d67ed..4a41b12e6af5b7 100644 --- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarIgnoredResourceBuildItemTest.java +++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarIgnoredResourceBuildItemTest.java @@ -25,7 +25,7 @@ class UberJarIgnoredResourceBuildItemTest { .setApplicationVersion("0.1-SNAPSHOT") .setRun(true) .setExpectExit(true) - .overrideConfigKey("quarkus.package.type", "uber-jar") + .overrideConfigKey("quarkus.package.jar.type", "uber-jar") .setForcedDependencies(List.of( // META-INF/cxf/cxf.fixml should be present in the cxf-rt-transports-http and cxf-core JARs Dependency.of("org.apache.cxf", "cxf-rt-transports-http", "3.4.3"))); diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarMergedResourceBuildItemTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarMergedResourceBuildItemTest.java index 23313921a4058a..609769b7131de4 100644 --- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarMergedResourceBuildItemTest.java +++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/UberJarMergedResourceBuildItemTest.java @@ -29,7 +29,7 @@ class UberJarMergedResourceBuildItemTest { .setApplicationVersion("0.1-SNAPSHOT") .setRun(true) .setExpectExit(true) - .overrideConfigKey("quarkus.package.type", "uber-jar") + .overrideConfigKey("quarkus.package.jar.type", "uber-jar") .setForcedDependencies(List.of( // META-INF/cxf/bus-extensions.txt should be present in the cxf-rt-transports-http and cxf-core JARs Dependency.of("org.apache.cxf", "cxf-rt-transports-http", "3.4.3"))); diff --git a/integration-tests/test-extension/tests/pom.xml b/integration-tests/test-extension/tests/pom.xml index 9635ce14d7a2ce..c00c53b56d37c5 100644 --- a/integration-tests/test-extension/tests/pom.xml +++ b/integration-tests/test-extension/tests/pom.xml @@ -173,7 +173,7 @@ - uber-jar + uber-jar diff --git a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-callback-from-extension/pom.xml b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-callback-from-extension/pom.xml index 28f07a35e09047..f41fb3e03aee83 100644 --- a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-callback-from-extension/pom.xml +++ b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-callback-from-extension/pom.xml @@ -120,7 +120,7 @@ - native + true diff --git a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-parameter-injection/pom.xml b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-parameter-injection/pom.xml index 84579c21da2f7e..03e894f32d6609 100644 --- a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-parameter-injection/pom.xml +++ b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-parameter-injection/pom.xml @@ -120,7 +120,7 @@ - native + true diff --git a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-template-from-extension/pom.xml b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-template-from-extension/pom.xml index ec4231504ee4aa..77a81d2ea59932 100644 --- a/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-template-from-extension/pom.xml +++ b/integration-tests/test-extension/tests/src/test/resources-filtered/projects/project-using-test-template-from-extension/pom.xml @@ -120,7 +120,7 @@ - native + true diff --git a/integration-tests/virtual-threads/pom.xml b/integration-tests/virtual-threads/pom.xml index 586794a724a9be..09b6f9ae56db3a 100644 --- a/integration-tests/virtual-threads/pom.xml +++ b/integration-tests/virtual-threads/pom.xml @@ -237,7 +237,7 @@ - native + true diff --git a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java index f77201d07bf6b5..bb75fc407f5ff4 100644 --- a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java +++ b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusProdModeTest.java @@ -410,7 +410,7 @@ public void close() throws Throwable { overrideConfigKey("quarkus.application.version", applicationVersion); } if (buildNative) { - overrideConfigKey("quarkus.package.type", "native"); + overrideConfigKey("quarkus.native.enabled", "true"); } exportArchive(deploymentDir, testClass);