简体   繁体   English

Spring 数据 Cassandra - 添加依赖项时构建失败

[英]Spring Data Cassandra - build fails when dependency is added

I was following this guide https://www.baeldung.com/spring-data-cassandra-tutorial to try and get started with using Cassandra paired with spring boot, however, the Cassandra connector dependency:我正在按照本指南https://www.baeldung.com/spring-data-cassandra-tutorial尝试开始使用 Cassandra 与 spring 启动配对,但是,Cassandra 连接器依赖项:

<!-- https://mvnrepository.com/artifact/com.datastax.oss/java-driver-core -->
<dependency>
    <groupId>com.datastax.oss</groupId>
    <artifactId>java-driver-core</artifactId>
    <version>4.14.0</version>
</dependency>

Doesn't seem to contain the necessary modules for adding an AbstractCassandraConfiguration.似乎不包含用于添加 AbstractCassandraConfiguration 的必要模块。 When adding spring-boot-starter-data-cassandra as a dependancy it gives me the required modules to add Cassandra configurations, but my build fails with the error:添加 spring-boot-starter-data-cassandra 作为依赖项时,它为我提供了添加 Cassandra 配置所需的模块,但我的构建失败并出现错误:

java: error reading `C:\Users\X\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar; zip END header not found`

Here is my pom.xml:这是我的 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 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>2.6.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.morpheus</groupId>
    <artifactId>reportdbgateway</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>reportdbgateway</name>
    <description>Charlie&apos;s software engineering assignment cassandra db gateway</description>
    <properties>
        <java.version>11</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-cassandra</artifactId>
        </dependency>

        <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>

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

</project>

My first approach would be going to:我的第一个方法是:

C:\Users\X.m2\repository\com\google\code\findbugs\jsr305\3.0.2 C:\Users\X.m2\repository\com\google\code\findbugs\jsr305\3.0.2

and delete:并删除:

jsr305-3.0.2.jar jsr305-3.0.2.jar

and then run a maven clean install or your goal然后运行 maven 全新安装或您的目标

Sometimes the jars are downloaded corrupted有时 jars 下载损坏

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将库添加为依赖项时,Spring初始化不起作用 - Spring initialization not working when the library is added as a dependency 为什么添加Spring依赖项时Maven插件为何显示错误 - Why does maven plugins show error when spring dependency is added 使用Spring进行依赖注入失败 - Dependency injection with Spring fails 关闭Spring ApplicationContext时Jenkins构建失败 - Jenkins build fails when closing Spring ApplicationContext 我在Pom.xml中添加了依赖项,但是Maven没有启动,Maven构建失败 - I have added dependency in Pom.xml but Maven is not picking up, maven build gets fails Spring 3.2 - 将 @EnableAsync 添加到 @Configuration 类时,项目无法加载 - Spring 3.2 - Project fails to load when @EnableAsync is added to @Configuration class JUnit + Spring:测试失败时的依赖注入-CannotLoadBeanClassException - JUnit + Spring: Dependency Injection when testing fails - CannotLoadBeanClassException 使用@Qualifier时,依赖注入在弹簧测试中失败 - Dependency injection fails on a spring test when using @Qualifier 由于缺少依赖项org.springframework.build.aws.maven,Spring Roo构建失败 - spring roo build fails because of missing dependency org.springframework.build.aws.maven Spring Data Cassandra和PreparedStatementCache - Spring Data Cassandra and PreparedStatementCache
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM