{"record":{"id":"fdb39615df4194d5","repo":"quarkusio/quarkus","slug":"no-google-cloud-function-found-on-the-classpath","errorCode":null,"errorMessage":"No Google Cloud Function found on the classpath","messagePattern":"No Google Cloud Function found on the classpath","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/GoogleCloudFunctionsProcessor.java","lineNumber":75,"sourceCode":"        IndexView index = combinedIndex.getIndex();\n        Collection<ClassInfo> httpFunctions = index.getAllKnownImplementors(DOTNAME_HTTP_FUNCTION);\n        Collection<ClassInfo> backgroundFunctions = index.getAllKnownImplementors(DOTNAME_BACKGROUND_FUNCTION);\n        Collection<ClassInfo> rawBackgroundFunctions = index.getAllKnownImplementors(DOTNAME_RAW_BACKGROUND_FUNCTION);\n        Collection<ClassInfo> cloudEventFunctions = index.getAllKnownImplementors(DOTNAME_CLOUD_EVENT_FUNCTION);\n\n        List<CloudFunctionBuildItem> cloudFunctions = new ArrayList<>();\n        cloudFunctions.addAll(\n                registerFunctions(unremovableBeans, httpFunctions, GoogleCloudFunctionInfo.FunctionType.HTTP));\n        cloudFunctions.addAll(\n                registerFunctions(unremovableBeans, backgroundFunctions, GoogleCloudFunctionInfo.FunctionType.BACKGROUND));\n        cloudFunctions.addAll(\n                registerFunctions(unremovableBeans, rawBackgroundFunctions,\n                        GoogleCloudFunctionInfo.FunctionType.RAW_BACKGROUND));\n        cloudFunctions.addAll(\n                registerFunctions(unremovableBeans, cloudEventFunctions, GoogleCloudFunctionInfo.FunctionType.CLOUD_EVENT));\n\n        if (cloudFunctions.isEmpty()) {\n            throw new BuildException(\"No Google Cloud Function found on the classpath\", Collections.emptyList());\n        }\n        return cloudFunctions;\n    }\n\n    private List<CloudFunctionBuildItem> registerFunctions(BuildProducer<UnremovableBeanBuildItem> unremovableBeans,\n            Collection<ClassInfo> functions,\n            GoogleCloudFunctionInfo.FunctionType functionType) {\n        List<CloudFunctionBuildItem> buildItems = new ArrayList<>();\n        for (ClassInfo classInfo : functions) {\n            String className = classInfo.name().toString();\n            unremovableBeans.produce(UnremovableBeanBuildItem.beanClassNames(className));\n            List<AnnotationInstance> annotationInstances = classInfo.annotationsMap().get(DOTNAME_NAMED);\n            CloudFunctionBuildItem buildItem = new CloudFunctionBuildItem(className, functionType);\n            if (annotationInstances != null) {\n                buildItem.setBeanName(annotationInstances.get(0).value().asString());\n            }\n            buildItems.add(buildItem);\n        }","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/google-cloud-functions/deployment/src/main/java/io/quarkus/gcp/functions/deployment/GoogleCloudFunctionsProcessor.java#L57-L93","documentation":"At build time the processor scans the application index for classes annotated as Google Cloud Functions (HTTP, CloudEvent, background). If none are found, the build fails with this BuildException, because a GCF project must contain at least one function.","triggerScenarios":"Building a project that depends on the Google Cloud Functions extension but has no class annotated with @GoogleCloudFunction (or equivalent function interfaces/annotations).","commonSituations":"Scaffolded project where the example function was deleted; annotation on a class outside the indexed application sources (e.g. only in a library not indexed as application class); wrong dependency added (plain gcp libraries instead of quarkus-google-cloud-functions).","solutions":["Add a class implementing/delegating a GCF function annotated with @GoogleCloudFunction to your application.","Verify you are using the quarkus-google-cloud-functions extension, not raw Google libraries.","Check that the function class is in your application's own sources (indexed) rather than only in a dependency.","Confirm the annotation is correct (e.g. com.google.cloud.functions invoker annotations / Quarkus GCF annotations) and not accidentally removed by a refactor."],"exampleFix":"// before\npublic class MyFunction { /* no function */ }\n// after\n@Named(\"fn\")\npublic class MyFunction implements CloudEventsFunction {\n    public void accept(CloudEvent event) { /* ... */ }\n}","handlingStrategy":"validation","validationCode":"// Check at least one function annotation exists before building\ngrep -rl '@GoogleCloudFunction\\|CloudEventsFunction\\|BackgroundFunction' src/main/java || \\\n  { echo 'No Google Cloud Function found'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep at least one @GoogleCloudFunction-annotated class in src/main/java","Use the Quarkus GCF quickstart as the template","Do not remove example functions from scaffolded projects without adding one","Verify the quarkus-google-cloud-functions extension dependency is present"],"tags":["build-time","google-cloud-functions","missing-class"],"backgroundTag":"missing-function-definition","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"}