{"record":{"id":"2885ad440b2dd541","repo":"quarkusio/quarkus","slug":"failed-to-locate-among-application-dependencies","errorCode":null,"errorMessage":"Failed to locate  among application dependencies","messagePattern":"Failed to locate  among application dependencies","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java","lineNumber":1329,"sourceCode":"                    sb.append(\", build-time classpath\");\n                }\n                if (d.isFlagSet(DependencyFlags.RUNTIME_EXTENSION_ARTIFACT)) {\n                    sb.append(\", extension\");\n                }\n                if (d.isFlagSet(DependencyFlags.RELOADABLE)) {\n                    sb.append(\", reloadable\");\n                }\n            }\n            sb.append(')');\n        }\n\n        private ResolvedDependencyBuilder getResolvedDependency(ArtifactKey key) {\n            var resolvedDep = appBuilder.getDependency(key);\n            if (resolvedDep == null) {\n                if (appBuilder.getApplicationArtifact().getKey().equals(key)) {\n                    return appBuilder.getApplicationArtifact();\n                }\n                throw new IllegalArgumentException(\"Failed to locate \" + key + \" among application dependencies\");\n            }\n            return resolvedDep;\n        }\n    }\n}\n","sourceCodeStart":1311,"sourceCodeEnd":1335,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/ApplicationDependencyResolver.java#L1311-L1335","documentation":"getResolvedDependency(key) looks up an artifact key in the application model being built (appBuilder.getDependency(key)); if absent — and it is not the application's own artifact — it throws this IllegalArgumentException. It means the resolver was asked for a dependency (typically while wiring an extension node) that was never recorded in the resolved application dependency set.","triggerScenarios":"BuildDependencyGraphVisitor.getResolvedDependency(ArtifactKey) is called with a key not present in appBuilder — e.g. a dependency node reached during graph visiting that was skipped by scope/optional filters earlier, or a key referring to a workspace/artifact filtered out of the final model.","commonSituations":"Dependencies excluded by scope (test/provided) but referenced by extension processing; workspace modules excluded via quarkus.workspace or .mvn/maven.config settings; version conflicts removing a node whose key is later requested; bootstrap bugs with conditional extension dependencies.","solutions":["Check mvn dependency:tree for the artifact key in the message and understand why it is absent (scope, exclusion, conflict mediation).","Remove <exclusions> or scope restrictions that filter the artifact out of the runtime classpath.","If using workspace discovery (local project builds), verify the project is part of the build (included in the reactor/quarkus.workspace.application-... config).","Reproduce with a minimal pom.xml and report to Quarkus if the dependency is clearly on the classpath — likely a resolver bug."],"exampleFix":"// before: artifact excluded, later looked up by an extension\n<dependency>\n  <groupId>com.acme</groupId>\n  <artifactId>myext</artifactId>\n  <exclusions>\n    <exclusion><groupId>io.quarkus</groupId><artifactId>quarkus-core</artifactId></exclusion>\n  </exclusions>\n</dependency>\n// after: drop the exclusion\n<dependency>\n  <groupId>com.acme</groupId>\n  <artifactId>myext</artifactId>\n</dependency>","handlingStrategy":"validation","validationCode":"// confirm the artifact is on the effective classpath before the build\nProcess p = new ProcessBuilder(\"mvn\", \"dependency:tree\", \"-Dverbose\")\n    .inheritIO().start();\np.waitFor();\n// inspect output: the missing key must appear without 'omitted for conflict' or exclusion","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid <exclusions> that filter artifacts extensions still need at build time.","Resolve version conflicts explicitly with dependencyManagement rather than letting mediation drop artifacts.","Keep workspace modules in the reactor when using local project resolution.","Review '-Dverbose' dependency trees for omitted-for-conflict entries when the error appears."],"tags":["quarkus-bootstrap","application-model","dependency-graph"],"backgroundTag":"dependency-not-found-in-model","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"}