Could not find method compile() for arguments [org.aspectj:aspectjrt:1.9.9.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. #10
Hello:
I am using gradle 7.4.2, AspectjGradlePlugin 0.0.7, openJDK 17 , aspectjVersion 1.9.9.1,
got an error:
A problem occurred configuring root project 'demo'.
> Could not find method compile() for arguments [org.aspectj:aspectjrt:1.9.9.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Here is my build.gradle file content :
plugins {
id 'org.springframework.boot' version '2.6.7'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "aspectj.AspectjGradlePlugin" version "0.0.7"
id 'java'
}
ext {
aspectjVersion = "1.9.9.1"
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
Hello: I am using gradle 7.4.2, AspectjGradlePlugin 0.0.7, openJDK 17 , aspectjVersion 1.9.9.1, got an error:
Here is my build.gradle file content :
I don't know how to fix it。 Thanks.