{"record":{"id":"a8e110b3d938703f","repo":"alibaba/spring-ai-alibaba","slug":"unknown-dependency-dep-check-project-metadata","errorCode":null,"errorMessage":"Unknown dependency '${dep}' check project metadata","messagePattern":"Unknown dependency '(.+?)' check project metadata","errorType":"validation","errorClass":"InvalidProjectRequestException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/GraphProjectReqToDescConverter.java","lineNumber":172,"sourceCode":"\t\t}\n\t}\n\n\tprivate void validatePackaging(String packaging, InitializrMetadata metadata) {\n\t\tif (packaging != null) {\n\t\t\tDefaultMetadataElement packagingFromMetadata = metadata.getPackagings().get(packaging);\n\t\t\tif (packagingFromMetadata == null) {\n\t\t\t\tthrow new InvalidProjectRequestException(\n\t\t\t\t\t\t\"Unknown packaging '\" + packaging + \"' check project metadata\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void validateDependencies(ProjectRequest request, InitializrMetadata metadata) {\n\t\tList<String> dependencies = request.getDependencies();\n\t\tdependencies.forEach((dep) -> {\n\t\t\tDependency dependency = metadata.getDependencies().get(dep);\n\t\t\tif (dependency == null) {\n\t\t\t\tthrow new InvalidProjectRequestException(\"Unknown dependency '\" + dep + \"' check project metadata\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate void validateDependencyRange(Version platformVersion, List<Dependency> resolvedDependencies) {\n\t\tresolvedDependencies.forEach((dep) -> {\n\t\t\tif (!dep.match(platformVersion)) {\n\t\t\t\tthrow new InvalidProjectRequestException(\n\t\t\t\t\t\t\"Dependency '\" + dep.getId() + \"' is not compatible \" + \"with Spring Boot \" + platformVersion);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate BuildSystem getBuildSystem(ProjectRequest request, InitializrMetadata metadata) {\n\t\tMap<String, String> typeTags = metadata.getTypes().get(request.getType()).getTags();\n\t\tString id = typeTags.get(\"build\");\n\t\tString dialect = typeTags.get(\"dialect\");\n\t\treturn BuildSystem.forIdAndDialect(id, dialect);","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/GraphProjectReqToDescConverter.java#L154-L190","documentation":"validateDependencies() iterates every dependency id in the request and resolves it in the Initializr metadata's dependency catalog. Any unknown id immediately throws InvalidProjectRequestException('Unknown dependency ... check project metadata'). All requested dependencies must be declared in metadata.getDependencies().","triggerScenarios":"Calling validate/convert with ProjectRequest dependencies containing at least one id absent from metadata.getDependencies().get(dep) — e.g. 'webflux-typo', a removed starter, or a custom dependency the admin metadata never registered.","commonSituations":"Hand-written dependency ids in scripts, upgrading spring-ai-alibaba where dependency ids were renamed, client cached metadata listing dependencies no longer offered.","solutions":["Fetch the current metadata (dependencies list) from the generator and use only listed dependency ids","Fix typos in dependency ids in the request","Register custom dependencies in the initializr metadata (initializr.dependencies)","Remove stale/renamed dependency ids after an upgrade"],"exampleFix":"// before\nrequest.setDependencies(Arrays.asList(\"web\", \"spring-ai-alibaba-starter-dashcope-typo\"));\n// after\nrequest.setDependencies(Arrays.asList(\"web\", \"spring-ai-alibaba-starter-dashscope\"));","handlingStrategy":"validation","validationCode":"Set<String> known = metadata.getDependencies().ids();\nList<String> bad = request.getDependencies().stream().filter(d -> !known.contains(d)).toList();\nif (!bad.isEmpty()) { throw new IllegalArgumentException(\"Unknown dependencies: \" + bad); }","typeGuard":null,"tryCatchPattern":"try {\n    converter.validate(request);\n} catch (InvalidProjectRequestException e) {\n    return ResponseEntity.badRequest().body(e.getMessage());\n}","preventionTips":["Fetch dependency ids from the metadata endpoint before composing requests","Re-validate dependency ids after upgrading spring-ai-alibaba","Keep a shared constant list of valid ids in client code"],"tags":["initializr","dependencies","validation","project-generation"],"backgroundTag":"invalid-enum-value","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}