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 57c9f32039113..811565ec04970 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 @@ -344,11 +344,19 @@ public static JarType fromString(String value) { @ConfigGroup interface DecompilerConfig { /** - * Enable decompilation of generated and transformed bytecode into the `decompiled` directory. + * Enable decompilation of generated and transformed bytecode into a filesystem. */ @WithDefault("false") boolean enabled(); + /** + * The directory into which to save the decompilation output. + *

+ * A relative path is understood as relative to the build directory. + */ + @WithDefault("decompiler") + String outputDirectory(); + /** * The directory into which to save the decompilation tool if it doesn't exist locally. */ 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 3323c0824516a..7efbcfcd670b4 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 @@ -635,7 +635,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem, Decompiler decompiler = null; PackageConfig.DecompilerConfig decompilerConfig = packageConfig.jar().decompiler(); if (decompilerConfig.enabled()) { - decompiledOutputDir = buildDir.getParent().resolve("decompiled"); + decompiledOutputDir = buildDir.getParent().resolve(decompilerConfig.outputDirectory()); FileUtil.deleteDirectory(decompiledOutputDir); Files.createDirectory(decompiledOutputDir); decompiler = new Decompiler.VineflowerDecompiler(); diff --git a/docs/src/main/asciidoc/writing-extensions.adoc b/docs/src/main/asciidoc/writing-extensions.adoc index bac8aab054435..cbcc824e82bfd 100644 --- a/docs/src/main/asciidoc/writing-extensions.adoc +++ b/docs/src/main/asciidoc/writing-extensions.adoc @@ -2259,6 +2259,7 @@ Quarkus generates a lot of classes during the build phase and in many cases also It is often extremely useful to see the generated bytecode and transformed classes during the development of an extension. If you set the `quarkus.package.jar.decompiler.enabled` property to `true` then Quarkus will download and invoke the https://github.com/Vineflower/vineflower[Vineflower decompiler] and dump the result in the `decompiled` directory of the build tool output (`target/decompiled` for Maven for example). +The output directory can be changed with `quarkus.package.jar.decompiler.output-dir`. NOTE: This property only works during a normal production build (i.e. not for dev mode/tests) and when `fast-jar` packaging type is used (the default behavior).