spring-boot - Gradle未找到Spring Boot依赖项

标签 spring-boot gradle

这是我的build.gradle文件

    plugins {
    id 'org.springframework.boot' version '2.2.1.RELEASE'
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
    id 'java'
}

group = 'de.quinscape'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-mail'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-context'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    compile("org.springframework.security:spring-security-ldap")
    compile group: 'com.h2database', name: 'h2', version: '1.4.197'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
}

这是我得到的错误:
Could not find org.springframework.boot:spring-context:.

我做错什么了?我使用Spring Initializer添加了所有依赖项。我只在那个特定的项目中得到这个错误。

最佳答案

只需删除implementation 'org.springframework.boot:spring-context',spring上下文将自动可用(具有间接依赖关系)

关于spring-boot - Gradle未找到Spring Boot依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59215757/

相关文章:

spring-boot - 将 Mongeez 与 Spring Boot 和 Spring Data MongoDB 集成

testing - 如何按名称运行单个 cucumber 场景

jenkins - 持续集成与自动构建器

java - Gradle wsdl生成

java - 两个实体之间的多种不同类型关联 - SpringBoot、PostgreSQL

java - 如何通过 maven-compiler-plugin 使用多个注释处理器

java - Spring Oauth2 注册重定向 URI

spring-boot - 将 Spring Boot 版本从 2.0.3.RELEASE 更改为 2.1.0.BUILD-SNAPSHOT 时出现问题

gradle - 使用 gradle 仅复制一个文件的最优雅方法是什么

spring-boot - 无法使用gradle和sts生成JPA元模型casse