首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用ajc的Gradle无法读取Lombok注释

使用ajc的Gradle无法读取Lombok注释
EN

Stack Overflow用户
提问于 2019-01-11 06:02:39
回答 1查看 266关注 0票数 0

我正在尝试将ajc编译器作为gradle插件添加到我的gradle项目中。不幸的是,在编译过程中,它显示了由于Lombok而导致的大量错误。

build.gradle:

代码语言:javascript
复制
group 'com.kmb.bank'
version '0.0.1-SNAPSHOT'

project.ext {
    aspectjVersion = '1.9.2'
}

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "gradle.plugin.aspectj:gradle-aspectj:0.1.6"
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "aspectj.gradle"

sourceCompatibility = 11
targetCompatibility = 11

repositories {
    mavenCentral()
}

dependencies {
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.7'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'commons-codec', name: 'commons-codec', version: '1.11'

    implementation('org.springframework.boot:spring-boot-starter-amqp')
    implementation('org.springframework.boot:spring-boot-starter-web')
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")
    compile ('org.springframework.boot:spring-boot-starter-security')
    compile("org.springframework.boot:spring-boot-starter-data-mongodb")
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-   aop', version: '2.1.1.RELEASE'
    }

它向我展示了没有每个模型的getter和setter的错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-15 07:58:32

这对我很有效:

代码语言:javascript
复制
plugins {
    id 'java'
    id "io.freefair.aspectj.post-compile-weaving" version "4.1.4"
}

group 'com.amdocs'
version '1.0.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'org.projectlombok', name: 'lombok', version: '1.18.10'
    annotationProcessor "org.projectlombok:lombok:1.18.10"
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54137556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档