{"record":{"id":"271f8d6f9926a713","repo":"quarkusio/quarkus","slug":"google-cloud-function-deployment-need-to-use-a-ube","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/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java","lineNumber":26,"sourceCode":"import 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    /**\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                    Collections.EMPTY_LIST);\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\", Collections.EMPTY_MAP);\n    }\n}\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/funqy/funqy-google-cloud-functions/deployment/src/main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/CloudFunctionsDeploymentBuildStep.java#L8-L44","documentation":"At build time, in production mode (non-native), the Google Cloud Functions deployment build step requires a uber-jar because 'gcloud' deploys a single deployable jar. If the produced jar is not a uber-jar, the build fails with a BuildException.","triggerScenarios":"Building a Funqy Google Cloud Function for production without quarkus.package.jar.type=uber-jar, so the JarBuildItem is not an uber-jar.","commonSituations":"Upgrading Quarkus where the default package type changed; copying build config from a non-GCF project; forgetting application.properties settings when adding GCF deployment.","solutions":["Set quarkus.package.jar.type=uber-jar in application.properties","Or build with -Dquarkus.package.jar.type=uber-jar","Note native builds and non-production builds skip this check"],"exampleFix":"// before (application.properties)\n# no package type set\n// after\nquarkus.package.jar.type=uber-jar","handlingStrategy":"validation","validationCode":"// in application.properties for GCF targets\nquarkus.package.jar.type=uber-jar","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set quarkus.package.jar.type=uber-jar for GCF Maven builds","Add it to the GCF deployment Maven profile","Re-check packaging config after Quarkus upgrades"],"tags":["build-time","google-cloud-functions","packaging","funqy"],"backgroundTag":"uber-jar-required","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"}