{"record":{"id":"896d379e7eccc303","repo":"quarkusio/quarkus","slug":"failed-to-locate-appartifactcoords-among-the-pr","errorCode":null,"errorMessage":"Failed to locate ${appArtifactCoords} among the project dependencies","messagePattern":"Failed to locate (.+?) among the project dependencies","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java","lineNumber":563,"sourceCode":"            } else if (coordsArr.length > 3) {\n                classifier = coordsArr[2] == null ? ArtifactCoords.DEFAULT_CLASSIFIER : coordsArr[2];\n                type = coordsArr[3] == null ? ArtifactCoords.TYPE_JAR : coordsArr[3];\n                if (coordsArr.length > 4) {\n                    version = coordsArr[4];\n                }\n            }\n            if (version == null) {\n                for (Artifact dep : mojo.mavenProject().getArtifacts()) {\n                    if (dep.getArtifactId().equals(artifactId)\n                            && dep.getGroupId().equals(groupId)\n                            && dep.getClassifier().equals(classifier)\n                            && dep.getType().equals(type)) {\n                        version = dep.getVersion();\n                        break;\n                    }\n                }\n                if (version == null) {\n                    throw new IllegalStateException(\n                            \"Failed to locate \" + appArtifactCoords + \" among the project dependencies\");\n                }\n            }\n\n            return ResolvedDependencyBuilder.newInstance()\n                    .setGroupId(groupId)\n                    .setArtifactId(artifactId)\n                    .setClassifier(classifier)\n                    .setType(type)\n                    .setVersion(version);\n        }\n\n        @Override\n        public void close() {\n            if (prodApp != null) {\n                prodApp.close();\n                prodApp = null;\n            }","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java#L545-L581","documentation":"When the appArtifact coordinate has no explicit version, the Quarkus Maven plugin tries to infer the version by scanning the project's dependencies for a dependency matching the given groupId, artifactId, classifier and type. This IllegalStateException is thrown when no such dependency exists in the project's resolved dependency list.","triggerScenarios":"Calling appArtifact with a coordinate lacking a version (e.g. 'com.acme:my-app') while no dependency with matching groupId/artifactId/classifier/type is present in the project's dependencies.","commonSituations":"Omitting the version segment from appArtifact while the artifact is not a project dependency; typo in groupId or artifactId so it doesn't match any dependency; the dependency was removed or renamed after a version upgrade; wrong classifier/type specified.","solutions":["Append an explicit version to the appArtifact coordinate, e.g. com.acme:my-app:1.0.0","Or add the artifact (with matching groupId:artifactId) as a dependency in the project pom.xml","Verify groupId/artifactId spelling matches the project dependency exactly, including classifier and type"],"exampleFix":"// before\n<appArtifact>com.acme:my-app</appArtifact>\n// after\n<appArtifact>com.acme:my-app:1.0.0</appArtifact>","handlingStrategy":"validation","validationCode":"// ensure version is present or the artifact is a project dependency\nString[] parts = appArtifactCoords.split(\":\");\nboolean hasVersion = parts.length == 5;\nboolean isDependency = project.getDependencies().stream()\n    .anyMatch(d -> d.getGroupId().equals(parts[0]) && d.getArtifactId().equals(parts[1]));\nif (!hasVersion && !isDependency) {\n    throw new IllegalStateException(\n        \"appArtifact \" + appArtifactCoords + \" has no version and is not a project dependency\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    mojo.appArtifact(coords);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Failed to locate\")) {\n        // add explicit version to coordinates or add the dependency to the pom\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always include the version in appArtifact coordinates","Keep appArtifact groupId:artifactId in sync with actual project dependencies","Re-check appArtifact coordinates after dependency refactors or version bumps"],"tags":["maven","dependency-resolution","coordinate-version"],"backgroundTag":"dependency-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"}