找不到方法实现()
我知道这是多次问的,但看来我尝试的一切都无法使用。
另外,我是新手,如果我犯了任何错误,我很抱歉。
我尝试使用Gradle和Eclipse构建一个Java罐。
Gradle构建看起来像这样:
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
defaultTasks 'clean', 'bootJar'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'com.oracle.database.jdbc:ojdbc8'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
group = 'com.ericsson.opt'
//version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
但是我总是最终得到:
在类型org.gradle.api.api.internal.artifacts.dsl.deppentencies.defaultDependDepentHandler.
无法找到参数[org.springframework.boot:org.springframework.boot:spring-boot-starter-starter-starter-data-jpa]的方法实现() /p>
现在,如果我使用编译而不是实现,则是同一问题,但使用编译而不是实现。 我正在使用的gradle是:
gradle- version
gradle 7.4.2
构建时间:2022-03-31 15:25:29 UTC 修订:540473B8118064EFCC264694CBCAA4B677F61041
KOTLIN:1.5.31 Groovy:3.0.9 ANT:Apache Ant(TM)版本1.10.11于2021年7月10日汇编 JVM:11.0.15(Oracle Corporation 11.0.15+8-LTS-149) 操作系统:Windows 10 10.0 AMD64
和Gradle的Eclipse插件是BuildShip gradle Integration 3.0
什么可能导致这一点,因为我从以前的搜索中理解它应该与Gradle版本有关,但我认为我在上一个版本上。
谢谢你,
I know this was asked several times over but it looks like everything I try doesn't work.
Also I'm new to this and I am sorry if I make any mistakes.
And I try to build a java jar using Gradle and eclipse.
The Gradle build looks like this:
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
defaultTasks 'clean', 'bootJar'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'com.oracle.database.jdbc:ojdbc8'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
group = 'com.ericsson.opt'
//version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
But I always end up with :
Could not find method implementation() for arguments [org.springframework.boot:spring-boot-starter-data-jpa] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Now if I use compile instead of implement it is the same problem but with compile instead of implement.
The Gradle I am using is :
Gradle --version
Gradle 7.4.2
Build time: 2022-03-31 15:25:29 UTC
Revision: 540473b8118064efcc264694cbcaa4b677f61041
Kotlin:1.5.31
Groovy:3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:11.0.15 (Oracle Corporation 11.0.15+8-LTS-149)
OS: Windows 10 10.0 amd64
And the eclipse plug-in for Gradle is Buildship Gradle Integration 3.0
What can cause this because I understand from previous searches it should be Gradle version related, but I think I'm on my last version.
Thank you,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先应用
Java
插件:Spring Boot的插件仅在Java插件的存在下进行反应,它们不会单独应用插件。
You need to apply the
java
plugin first:Spring Boot's plugins only react on the presence of the Java plugin, they don't apply the plugin on their own.