gpt4 book ai didi

java - Gradle with ajc 不读取 Lombok 注释

转载 作者:行者123 更新时间:2023-12-02 10:23:46 29 4
gpt4 key购买 nike

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

构建.gradle:

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。

最佳答案

这对我有用:

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"
}

关于java - Gradle with ajc 不读取 Lombok 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54137556/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com