{"record":{"id":"395e69d309c2a9ba","repo":"quarkusio/quarkus","slug":"the-google-cloud-extensions-are-incompatible-with","errorCode":null,"errorMessage":"The Google Cloud extensions are incompatible with the 'native-sources' package type.","messagePattern":"The Google Cloud extensions are incompatible with the 'native-sources' package type\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java","lineNumber":22,"sourceCode":"import java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Map;\n\nimport io.quarkus.builder.BuildException;\nimport io.quarkus.deployment.IsProduction;\nimport io.quarkus.deployment.annotations.BuildProducer;\nimport io.quarkus.deployment.annotations.BuildStep;\nimport io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;\nimport io.quarkus.deployment.pkg.builditem.JarBuildItem;\nimport io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;\nimport io.quarkus.deployment.pkg.steps.NativeBuild;\nimport io.quarkus.deployment.pkg.steps.NativeSourcesBuild;\n\npublic class CloudFunctionDeploymentBuildStep {\n    @BuildStep(onlyIf = NativeSourcesBuild.class)\n    void failForNativeSources(BuildProducer<ArtifactResultBuildItem> artifactResultProducer) {\n        throw new IllegalArgumentException(\n                \"The Google Cloud extensions are incompatible with the 'native-sources' package type.\");\n    }\n\n    /**\n     * Creates a target/deployment dir and copy the uber jar in it.\n     * This facilitates the usage of the 'gcloud' command.\n     */\n    @BuildStep(onlyIf = IsProduction.class, onlyIfNot = NativeBuild.class)\n    public ArtifactResultBuildItem functionDeployment(OutputTargetBuildItem target, JarBuildItem jar)\n            throws BuildException, IOException {\n        if (!jar.isUberJar()) {\n            throw new BuildException(\"Google Cloud Function deployment need to use a uberjar, \" +\n                    \"please set 'quarkus.package.jar.type=uber-jar' inside your application.properties\",\n                    List.of());\n        }\n\n        Path deployment = target.getOutputDirectory().resolve(\"deployment\");\n        if (Files.notExists(deployment)) {","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java#L4-L40","documentation":"During the Quarkus build, when the package type is 'native-sources', this build step intentionally aborts the build because the Google Cloud Functions extensions do not support that packaging mode. It throws IllegalArgumentException so the build fails fast instead of producing a deployable that will not work on GCF.","triggerScenarios":"Building a Google Cloud Functions project with quarkus.package.type=native-sources (the package type used to compile native sources on a separate machine/container).","commonSituations":"CI pipelines that compile native images out-of-cluster using the native-sources output; users following generic native-sources guides with a GCF project.","solutions":["Remove quarkus.package.type=native-sources from your configuration.","Use quarkus.package.type=native (build the native image in place) if you need a native GCF function.","Use the default uber-jar packaging if deploying a JVM-based GCF function.","Split the build: produce the uber-jar with GCF, or handle native compilation differently than native-sources."],"exampleFix":"// before (application.properties)\nquarkus.package.type=native-sources\n// after\nquarkus.package.type=native","handlingStrategy":"validation","validationCode":"// fail fast in your CI before building\nif [ \"$(grep -E 'quarkus.package.type=native-sources' src/main/resources/application.properties)\" ]; then\n  echo \"native-sources is unsupported for Google Cloud Functions\"; exit 1;\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set quarkus.package.type=native-sources in GCF projects","Use quarkus.package.type=native for native GCF functions","Review CI packaging overrides before enabling native-sources builds","Pin GCF packaging config in application.properties and code-review changes"],"tags":["build-time","google-cloud-functions","packaging"],"backgroundTag":"unsupported-package-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}