gpt4 book ai didi

spring - 尝试添加 spring-data 时缺少 Artifact

转载 作者:行者123 更新时间:2023-12-01 18:21:07 25 4
gpt4 key购买 nike

我正在尝试将 spring 数据依赖项添加到我的 Spring boot 入门项目中,但收到错误:缺少 Artifact org.springframework.data:spring-data-jdbc-ext:jar:1.0.0。发布

这是我的 pom.xml 文件。我在这里缺少什么?

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>myApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.0.RC1</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-ext</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
</dependencies>

<properties>
<start-class>com.test.Application</start-class>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

最佳答案

出于某种原因,Spring Data JDBC Extensions 上的文档网站错误(或者分布错误!)。

根据该页面,您确实需要包含您提到的依赖项。

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-ext</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>

但是如果你看一下 the spring repository对于该 Artifact ,它包含带有版本的 zip 文件,而不是 jar 或 pom 文件。

spring-data-jdbc-ext 项目由 2 个 Artifact 组成,两者都可用。将您的依赖项更改为以下内容

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc-core</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-oracle</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>

如果您不需要特定的 Oracle 扩展,则可以忽略该扩展。

需要注意的是,还有一个 1.1.0.M1 版本(里程碑/预发布版本),可与较新版本的 Spring Data 配合使用。您可能想尝试使用它,而不是针对旧版本的 Spring Data 构建的 1.0.0.RELEASE 版本。

关于spring - 尝试添加 spring-data 时缺少 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21466251/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com