[英]Spring Boot cannot find spring-boot-starter-dao-jpa package using 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"]
}
看起來當我重構項目結構時,intellij變得很聰明並重命名了依賴項。 小心那一個!
在Spring Maven Repository中沒有spring-boot-starter-dao-jpa
跡象,所以我懷疑它不存在。 嘗試刪除該行。
也許這是來自以下兩行的spring-boot-starter-data-jpa
依賴項的復制和粘貼錯誤...?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.