arendd / AspectjGradlePlugin

AspectJ Plugin for Gradle 5+
11 stars 4 forks source link

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

Open qb345801622 opened 2 years ago

qb345801622 commented 2 years ago

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()
}

I don't know how to fix it。 Thanks.

Mua-Zei commented 2 years ago

老哥你解决这个问题了吗,求指点

qb345801622 commented 2 years ago

并没有。