【发布时间】:2019-12-03 05:18:54
【问题描述】:
我想在我使用 kotlin DSL 的 gradle 项目中配置 aspectJ 插件。
下面是我的build.gradle.kts 文件。
val aspectjVersion = "1.9.3"
plugins {
java
id("aspectj.gradle") version "0.1.6"
}
group = "java-agents-demo"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
implementation("org.aspectj","aspectjrt", aspectjVersion)
implementation("org.aspectj","aspectjweaver", aspectjVersion)
testCompile("junit", "junit", "4.12")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
当我运行 compileJava 项目时,我收到错误“您必须在应用 aspectj 插件之前设置属性 'aspectjVersion'”。
我在构建文件中设置了aspectjVersion,但我不知道其中的错误是什么。
谁能帮我以正确的方式为我的项目设置 aspectJ 插件?
【问题讨论】:
标签: gradle build.gradle gradle-plugin gradle-kotlin-dsl