引入 Spring AI 依赖报错Could not find artifact org.springframework.ai...
4114
1
作者:毅念安(Inian / Emanjusaka)|原创,后续会更新修正,转载请保留原文链接。
📝 独立博客:https://www.emanjusaka.com|博客园:https://www.cnblogs.com/emanjusaka|公众号:毅念安
报错信息
Could not find artifact org.springframework.ai:spring-ai-bom:pom:1.1.0 in aliyunmaven
<properties>
<spring-ai.version>1.1.0</spring-ai.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>${spring-ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
通过阿里云仓库引入 Spring AI 的依赖会报上面的错误
解决方案
问题出在了依赖的组 ID 上
不知道什么原因阿里云仓库中有关 Spring AI 依赖的组 ID 改成了group.springframework.ai而不是org.springframework.ai
可能是Spring 官方还没有正式发布这个 maven 依赖,所以阿里云仓库修改了组 ID 临时使用下。
修改一下组 ID 就可以成功导入了