spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

[AI] spring-ai: 0.8.1 dependency not found

Open sichenyong opened this issue 1 year ago • 3 comments

I get trouble when I try to learn Spring Cloud Alibaba AI:(https://sca.aliyun.com/docs/2023/user-guide/ai/quick-start/)

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2023.0.1.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>

    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-ai</artifactId>
        </dependency>
    </dependencies>

I can't import spring-ai-core:0.8.1 even if i changed the mirror of maven to aliyun repository.

here is my maven configuration file :

<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>*</mirrorOf>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

I went to aliyun repository to search spring-ai-core:0.8.1 , but no result for it: image

I can't figure out it. what should i do ? Change the mirror?

sichenyong avatar Apr 30 '24 05:04 sichenyong

Great to see you using spring cloud alibaba ai. You may have forgotten one important point

spring ai has not been published to the maven central repository yet, you need to configure the repository address additionally in maven:

  • https://docs.spring.io/spring-ai/reference/0.8-SNAPSHOT/getting-started.html#repositories
  • https://github.com/alibaba/spring-cloud-alibaba/blob/26d483d7220cdfc23c33e40c6204fdf3f5561ef9/spring-cloud-alibaba-examples/spring-cloud-ai-example/pom.xml#L62

yuluo-yx avatar Apr 30 '24 12:04 yuluo-yx

/area ai /kind question

yuluo-yx avatar Apr 30 '24 12:04 yuluo-yx

Hi, I also met this problem. You can try to add a remote repository to pom.xml as this will make maven search for spring-ai-core in this repository.

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

However, please note that you also need to change <mirrorOf>*</mirrorOf>, as this config redirect all the maven dependency request to aliyun maven repository. You need to change it to <mirrorOf>*,!spring-milestones</mirrorOf>to exclude spring-snapshots. note that no space between ,and ! This should solve your problem.

PeterZh6 avatar May 04 '24 18:05 PeterZh6

maven镜像,从阿里改为默认配置,可以拉取

TKCC29 avatar Jul 25 '24 06:07 TKCC29