{"record":{"id":"fc8f7275dc8f70ee","repo":"quarkusio/quarkus","slug":"google-cloud-function-deployment-need-to-use-a-ube-fc8f72","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-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java","lineNumber":26,"sourceCode":"\nimport io.quarkus.builder.BuildException;\nimport io.quarkus.deployment.IsProduction;\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;\n\npublic class CloudFunctionsDeploymentBuildStep {\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":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions-http/deployment/src/main/java/io/quarkus/gcp/functions/http/deployment/CloudFunctionsDeploymentBuildStep.java#L8-L44","documentation":"A Quarkus build-time BuildException from CloudFunctionsDeploymentBuildStep.functionDeployment: in production JVM mode the Google Cloud Functions deployment step requires an uber-jar, and the build produced a non-uber (fast-jar/legacy) jar instead. The build fails fast so gcloud deploys a valid single-jar artifact.","triggerScenarios":"Running a production build (IsProduction) without native mode while quarkus.package.jar.type is not uber-jar, then executing the functionDeployment build step.","commonSituations":"Upgraded Quarkus where the default packaging changed to fast-jar but the GCP functions deployment still expects uber-jar; newly created function project missing the packaging property in application.properties.","solutions":["Set quarkus.package.jar.type=uber-jar in application.properties","Rebuild the application so the deployment artifact step completes","If you intended a container-based deploy, consider the native or container build path instead of the uber-jar deployment step"],"exampleFix":"# before\n# (no packaging config — defaults to fast-jar)\n# after\nquarkus.package.jar.type=uber-jar","handlingStrategy":"validation","validationCode":"// check packaging config before building for GCP\nProperties p = new Properties();\np.load(new FileInputStream(\"src/main/resources/application.properties\"));\nif (!\"uber-jar\".equals(p.getProperty(\"quarkus.package.jar.type\"))) {\n    throw new IllegalStateException(\"GCP functions need quarkus.package.jar.type=uber-jar\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    QuarkusBuildRunner.run(\"package\");\n} catch (QuarkusBuildException e) {\n    if (e.getMessage().contains(\"uberjar\")) {\n        // fix application.properties then rebuild\n    } else throw e;\n}","preventionTips":["Always set quarkus.package.jar.type=uber-jar in GCP function projects","Re-verify packaging config after Quarkus upgrades (defaults change)","Run the full package build in CI so the failure surfaces before deploy","Do not override the packaging type via CLI flags in function builds"],"tags":["gcp","build","packaging","uber-jar"],"backgroundTag":"invalid-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"}