{"record":{"id":"53fd0f589cf7bfd3","repo":"quarkusio/quarkus","slug":"failed-to-find-location-among-dependencies","errorCode":null,"errorMessage":"Failed to find ${location} among dependencies","messagePattern":"Failed to find (.+?) among dependencies","errorType":"exception","errorClass":"CodeGenException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java","lineNumber":513,"sourceCode":"\n    private Path prepareExecutable(Path buildDir, ApplicationModel model,\n            String groupId, String artifactId, String classifier, String packaging) throws CodeGenException {\n        Path artifactPath = findArtifactPath(model, groupId, artifactId, classifier, packaging);\n\n        return makeExecutableFromPath(buildDir, groupId, artifactId, classifier, packaging, artifactPath);\n    }\n\n    private Path makeExecutableFromPath(Path buildDir, String groupId, String artifactId, String classifier, String packaging,\n            Path artifactPath) throws CodeGenException {\n        Path exe = buildDir.resolve(String.format(\"%s-%s-%s-%s\", groupId, artifactId, classifier, packaging));\n\n        if (Files.exists(exe)) {\n            return exe;\n        }\n\n        if (artifactPath == null) {\n            String location = String.format(\"%s:%s:%s:%s\", groupId, artifactId, classifier, packaging);\n            throw new CodeGenException(\"Failed to find \" + location + \" among dependencies\");\n        }\n\n        try {\n            Files.copy(artifactPath, exe, StandardCopyOption.REPLACE_EXISTING);\n        } catch (IOException e) {\n            throw new CodeGenException(\"Failed to copy file: \" + artifactPath + \" to \" + exe, e);\n        }\n        if (!exe.toFile().setExecutable(true)) {\n            throw new CodeGenException(\"Failed to make the file executable: \" + exe);\n        }\n        return exe;\n    }\n\n    private static Path findArtifactPath(ApplicationModel model, String groupId, String artifactId, String classifier,\n            String packaging) {\n        Path artifactPath = null;\n\n        for (ResolvedDependency artifact : model.getDependencies()) {","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java#L495-L531","documentation":"During gRPC code generation Quarkus needs native protoc and protoc-gen-grpc-java binaries matching the OS classifier (e.g. linux-x86_64). makeExecutableFromPath throws this CodeGenException when neither a previously copied executable nor the matching artifact (groupId:artifactId:classifier:packaging) is found among the application's resolved dependencies.","triggerScenarios":"Running code generation where the dependency model does not contain e.g. com.google.protobuf:protoc:exe:linux-x86_64 or io.grpc:protoc-gen-grpc-java:exe:<classifier> — typically because the quarkus-grpc extension's managed protoc artifacts were excluded, the platform BOM was overridden, or the OS classifier string does not match any published binary.","commonSituations":"Custom dependency management excluding '*:exe' classifier artifacts; a corporate repository mirror missing native classifier artifacts; uncommon OS/arch combination (e.g. linux-aarch_64 variants) with no matching binary; overriding the protobuf/grpc version in dependencyManagement so the classifier entry changed.","solutions":["Verify io.quarkus:quarkus-grpc (and its platform BOM) is on the build classpath so protoc artifacts are managed transitively","Check dependencyManagement/exclusions are not filtering the native classifier artifacts (com.google.protobuf:protoc, io.grpc:protoc-gen-grpc-java)","Run with -X or inspect the resolved dependency list to confirm the exe-classified artifact resolves from your repository/mirror","Set the system property -Dquarkus.grpc.protoc-path=/path/to/protoc to supply your own protoc binary, bypassing the lookup","Override -Dquarkus.grpc.protoc-os-classifier to force a classifier that exists in your repository"],"exampleFix":"// before: excluding native artifacts\nglobalExcludes.add(\"com.google.protobuf:*\");\n// after: allow protoc native classifier or supply binary explicitly\nmvn -Dquarkus.grpc.protoc-path=/usr/local/bin/protoc clean compile","handlingStrategy":"validation","validationCode":"// confirm the native protoc artifact resolves before building\ndependencyTree.resolve(\"com.google.protobuf:protoc:exe:\" + osClassifier);\n// or check manually:\n// mvn dependency:tree -Dincludes=com.google.protobuf:protoc","typeGuard":null,"tryCatchPattern":"try {\n    build.run();\n} catch (CodeGenException e) {\n    if (e.getMessage().contains(\"Failed to find\") && e.getMessage().contains(\"among dependencies\")) {\n        // fall back to a locally installed protoc\n        System.setProperty(\"quarkus.grpc.protoc-path\", \"/usr/local/bin/protoc\");\n        build.run();\n    }\n}","preventionTips":["Do not exclude com.google.protobuf:protoc or io.grpc:protoc-gen-grpc-java exe-classified artifacts","Verify your corporate mirror proxies all classifiers for these artifacts","Keep quarkus-grpc and the Quarkus BOM at the same version","Set -Dquarkus.grpc.protoc-path when building in restricted environments"],"tags":["grpc","codegen","dependencies","protoc"],"backgroundTag":"artifact-not-found","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"}