{"record":{"id":"460339e482024ee2","repo":"quarkusio/quarkus","slug":"google-cloud-function-deployment-need-to-use-a-ube-460339","errorCode":null,"errorMessage":"Google Cloud Function deployment need to use a uberjar, please set 'quarkus.package.jar.type=uber-jar' inside your application.properties","messagePattern":"Google Cloud Function deployment need to use a uberjar, please set 'quarkus\\.package\\.jar\\.type=uber-jar' inside your application\\.properties","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java","lineNumber":34,"sourceCode":"import 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)) {\n            Files.createDirectory(deployment);\n        }\n\n        Path jarPath = jar.getPath();\n        Path targetJarPath = deployment.resolve(jarPath.getFileName());\n        Files.deleteIfExists(targetJarPath);\n        Files.copy(jarPath, targetJarPath);\n\n        return new ArtifactResultBuildItem(targetJarPath, \"function\", Map.of());\n    }\n}\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/CloudFunctionDeploymentBuildStep.java#L16-L52","documentation":"Google Cloud Function deployment for production requires a single uber-jar so gcloud can deploy it; if the build produced a non-uber jar, this build step fails with a BuildException telling you to set the uber-jar package type. It enforces the packaging requirement of GCF's Java runtime.","triggerScenarios":"Running the production build of a Google Cloud Functions project with a package type other than uber-jar (e.g. quarkus.package.type=jar, the default fast-jar), while not building native.","commonSituations":"Upgraded projects where the default packaging changed away from uber-jar; new projects created without GCF-specific packaging config; CI builds overriding quarkus.package.jar.type.","solutions":["Set quarkus.package.jar.type=uber-jar in application.properties.","Or build with -Dquarkus.package.jar.type=uber-jar on the command line.","If you intend a native GCF function, build with -Dnative instead (this check is skipped for native builds)."],"exampleFix":"// before (application.properties)\n# no package config (defaults to fast jar)\n// after\nquarkus.package.jar.type=uber-jar","handlingStrategy":"validation","validationCode":"// CI pre-check\nif ! grep -q 'quarkus.package.jar.type=uber-jar' src/main/resources/application.properties; then\n  echo \"GCF requires quarkus.package.jar.type=uber-jar\"; exit 1;\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set quarkus.package.jar.type=uber-jar in GCF JVM projects","Override explicitly in CI: mvn package -Dquarkus.package.jar.type=uber-jar","Re-verify packaging config after Quarkus upgrades (defaults changed historically)","Use the quarkus-google-cloud-functions quickstart as config reference"],"tags":["build-time","google-cloud-functions","packaging","uber-jar"],"backgroundTag":"missing-build-configuration","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}