[英]Spring Boot cannot find spring-boot-starter-dao-jpa package using Gradle?
I have the following Gradle file: 我有以下Gradle文件:
I had this working fine, but all of the sudden it seems like this JPA package cannot be found. 我的工作正常,但突然之间似乎找不到此JPA软件包。 I have added it
compile("org.springframework.boot:spring-boot-starter-dao-jpa")
我已经添加了它
compile("org.springframework.boot:spring-boot-starter-dao-jpa")
Every time I try and build, it complains about this. 每当我尝试构建时,它都会抱怨。 I check the dependency graph and it has a red underline to show it's missing.
我检查了依赖关系图,它有一个红色的下划线表示它丢失了。 What can I do?
我能做什么?
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"]
}
It looks like when I refactored my project structure, intellij got clever and renamed the dependencies. 看起来当我重构项目结构时,intellij变得很聪明并重命名了依赖项。 Be careful on that one!
小心那一个!
There is no sign of spring-boot-starter-dao-jpa
in the Spring Maven Repository , so I suspect it doesn't exist. 在Spring Maven Repository中没有
spring-boot-starter-dao-jpa
迹象,所以我怀疑它不存在。 Try removing the line. 尝试删除该行。
Maybe this was a copy & paste error from the spring-boot-starter-data-jpa
dependency two lines below...? 也许这是来自以下两行的
spring-boot-starter-data-jpa
依赖项的复制和粘贴错误...?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.