{"record":{"id":"7c811948a04cec4c","repo":"alibaba/spring-ai-alibaba","slug":"dependency-depid-is-not-compatible-with-sprin","errorCode":null,"errorMessage":"Dependency '${depId}' is not compatible with Spring Boot ${platformVersion}","messagePattern":"Dependency '(.+?)' is not compatible with Spring Boot (.+?)","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":180,"sourceCode":"\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);\n\t}\n\n\tprivate Version getPlatformVersion(ProjectRequest request, InitializrMetadata metadata) {\n\t\tString versionText = (request.getBootVersion() != null) ? request.getBootVersion()\n\t\t\t\t: metadata.getBootVersions().getDefault().getId();\n\t\tVersion version = Version.parse(versionText);\n\t\treturn this.platformVersionTransformer.transform(version, metadata);\n\t}","sourceCodeStart":162,"sourceCodeEnd":198,"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#L162-L198","documentation":"validateDependencyRange() checks each resolved Dependency's compatibility range against the requested Spring Boot platform version via dep.match(platformVersion). A dependency whose version range excludes the requested Boot version causes InvalidProjectRequestException('Dependency X is not compatible with Spring Boot <version>'). This prevents generating projects that combine a Boot version a dependency does not support.","triggerScenarios":"Requesting a project with dependencies whose metadata compatibility ranges (initializr dependency 'compatibilityRange') do not include the request's bootVersion — e.g. a Spring AI starter requiring Boot 3.2+ while requesting bootVersion 3.0.x.","commonSituations":"Mixing an old Boot version with newer Spring AI Alibaba starters, initializr metadata declaring narrow compatibility ranges, upgrading a dependency that raised its minimum supported Boot version.","solutions":["Raise the request's bootVersion to one within every dependency's compatibility range (e.g. latest 3.x)","Or drop/replace the incompatible dependency from the request","Update the dependency's compatibilityRange in initializr metadata if it is unnecessarily restrictive"],"exampleFix":"// before\nrequest.setBootVersion(\"3.0.0\");\nrequest.setDependencies(List.of(\"spring-ai-alibaba-starter-dashscope\")); // needs Boot >= 3.2\n// after\nrequest.setBootVersion(\"3.2.5\");\nrequest.setDependencies(List.of(\"spring-ai-alibaba-starter-dashscope\"));","handlingStrategy":"validation","validationCode":"// client-side guard\nif (requestedBootVersion.compareTo(Version.safeParse(\"3.2.0\")) < 0 && deps.contains(\"spring-ai-alibaba-starter-dashscope\")) {\n    throw new IllegalArgumentException(\"starter requires Spring Boot 3.2+\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.doConvert(request, metadata);\n} catch (InvalidProjectRequestException e) {\n    return ResponseEntity.badRequest().body(e.getMessage());\n}","preventionTips":["Check each dependency's compatibilityRange in metadata before selecting a bootVersion","Prefer the metadata's default Boot version","Track dependency minimum-Boot bumps in release notes"],"tags":["initializr","dependencies","version-compatibility","spring-boot"],"backgroundTag":"incompatible-source-type","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"}