帝国cms手机网站教程百度竞价推广方案范文
Spring AI 1.0.0-M6
- 入门
- 一、存储库
- 二、依赖管理
- 完整maven
入门
Spring 是JAVA中我们经常使用的框架之一,Spring AI不断的发展迭代目前已经到M6版本据说上半年会出一个稳定版本。
本节提供了如何开始使用Spring AI的M6。
一、存储库
1.0 M6 -添加Spring存储库
需要将Spring里程碑和快照存储库添加到构建系统中。如果您更喜欢手动添加依赖项片段,请按照以下部分中的说明操作。
要使用Milestone和Snapshot版本,您需要在构建文件中添加对Spring Milestone和/或Snapshot存储库的引用。
将以下存储库定义添加到您的Maven构建文件:
<repositories><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository><repository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><releases><enabled>false</enabled></releases></repository>
</repositories>
二、依赖管理
Spring AI Bill of Materials (BOM) 声明了Spring AI给定版本使用的所有依赖项的推荐版本。 使用应用程序构建脚本中的BOM,无需您自己指定和维护依赖项版本。 相反,您使用的BOM表版本决定了所使用的依赖关系版本。 它还确保您在默认情况下使用依赖项的受支持和测试版本,除非您选择覆盖它们。
将BOM表添加到项目中:
<dependencyManagement><dependencies><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-bom</artifactId><version>1.0.0-M6</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>
完整maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.4.3</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.qijc</groupId><artifactId>ai-springboot-starting</artifactId><version>0.0.1-SNAPSHOT</version><name>ai-springboot-starting</name><description>ai-springboot-starting</description><properties><java.version>17</java.version><spring-ai.version>1.0.0-M6</spring-ai.version></properties><repositories><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository><repository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><releases><enabled>false</enabled></releases></repository></repositories><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></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><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>