Gradle:无法获取未知属性';classesDir';主要课程

Gradle:无法获取未知属性';classesDir';主要课程,gradle,Gradle,根据,我已经尝试使用aspectj插件 这是我在构建项目时得到的信息 FAILURE: Build failed with an exception. * Where: Build file '/home/jesudi/projects/gradle-vscode/build.gradle' line: 22 * What went wrong: A problem occurred evaluating root project 'security'. > Failed to app

根据,我已经尝试使用aspectj插件

这是我在构建项目时得到的信息

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jesudi/projects/gradle-vscode/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'security'.
> Failed to apply plugin [id 'aspectj.gradle']
   > Could not create task ':compileAspect'.
      > Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
这是我的剧本:

buildscript {
    repositories {
        mavenCentral()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "org.apache.meecrowave:meecrowave-gradle-plugin:1.2.6"
        classpath "gradle.plugin.aspectj:gradle-aspectj:0.1.6"
    }
}

plugins {
    id 'java'
}

project.ext {
    aspectjVersion = '1.9.2'
}

apply plugin: 'aspectj.gradle'
apply plugin: "org.apache.microwave.microwave"

java {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

dependencies {
    compile("org.apache.meecrowave:meecrowave-core:1.2.6")
    compile("org.apache.meecrowave:meecrowave-specs-api:1.2.6")
}

meecrowave {
    httpPort = 9090
    // most of the meecrowave core configuration
}
这是
gradle-version
输出:

------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------

Build time:   2019-01-10 23:05:02 UTC
Revision:     3c9abb645fb83932c44e8610642393ad62116807

Kotlin DSL:   1.1.1
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.2 (Oracle Corporation 11.0.2+9)
OS:           Linux 4.15.0-20-generic amd64

在gradle 4.x中,
classesDir
属性被弃用,在gradle 5.x中被删除(请参阅)


该插件显然没有得到维护。

可能您的插件不是问题的根源,但Gradle的版本是。 我第一次在libgdx游戏(androidstudio)中遇到同样的错误。 在build.gradle(桌面)文件中,“classDir”被重命名为classesDirs,这很有帮助

from files(sourceSets.main.output.classesDirs)

在Gradle 5.x中,此属性已从
classesDir
重命名为
classesDirs


您可以找到更多信息

我收到了一条类似的错误消息,不是使用此插件,而是使用Grails(3.2.9)创建的HelloWorld应用程序。在我的例子中,我已经使用sdkman将当前的Gradle设置为3.5而不是5,但问题仍然存在。结果是,“Grails”cli()使用了Gradle的默认sdkman版本(与“当前”版本不同)。
从Grails3.3.X中,可以设置“GradleRapPerversion=3.5”“改为使用gradle.properties,或者像以前一样使用GRAILS\u gradle\u HOME环境变量。

您指的是哪个插件?问题和错误消息所涉及的插件。我可以看到脚本应用了两个插件:
aspectj.gradle
org.apache.microwave.microwave
。因此我感到困惑。