java - Spring Boot 使用 Gradle 找不到 spring-boot-starter-dao-jpa 包?

标签 java spring spring-boot gradle

我有以下 Gradle 文件:

我有这个工作正常,但突然之间似乎找不到这个 JPA 包。我已添加 compile("org.springframework.boot:spring-boot-starter-dao-jpa")
每次我尝试构建时,它都会提示这一点。我检查了依赖关系图,它有一个红色下划线表示它丢失了。我能做些什么?

buildscript {
    ext {
        springBootVersion = '2.0.1.RELEASE'
    }

    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven'

group = 'com.remindful'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-jersey')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-web-services')
    compile('org.springframework.boot:spring-boot-starter-websocket')
    compile('org.springframework.session:spring-session-core')
    compile("org.springframework.boot:spring-boot-starter-dao-jpa")
    compile("com.h2database:h2:1.4.191")
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile group: 'com.google.guava', name: 'guava', version: '11.0.2'
    compile group: 'com.h2database', name: 'h2', version: '1.4.197'
    testCompile 'junit:junit:4.12'
    testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.0.1.RELEASE'
}

// To force debug on application boot, switch suspend to y
bootRun {
    systemProperties System.properties
    jvmArgs=["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"]
}

最佳答案

没有spring-boot-starter-dao-jpa的迹象在 Spring Maven Repository ,所以我怀疑它不存在。尝试删除线。

也许这是来自 spring-boot-starter-data-jpa 的复制和粘贴错误依赖下面两行...?

关于java - Spring Boot 使用 Gradle 找不到 spring-boot-starter-dao-jpa 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49959051/

相关文章:

java - 将本地 SOA 应用程序移出本地或迁移到云中

java - 如何用javapoet动态生成代码?更改方法参数

java - Fortify 在分析中包含生成源

java - Spring Boot数据,MongoDB不返回结果

Spring 事务在类到类级别和方法到方法级别上的传播

spring-boot - 如何将 GlobalMethodSecurityConfiguration 迁移到 Reactive Spring?

tomcat - 多个 Spring-boot 应用程序运行在一个 Tomcat 上

java - 为什么我的 Java try...catch 会出错?

java - Liquibase ChangeSet 与 runAlways 不由 liquibase.update 执行

java - 为什么当 ftp java dsl 配置被引入 spring 集成核心时过滤器行为发生了变化