📌  相关文章
📜  改为 CompileOptions.annotationProcessorPath` 属性. - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:55.386000             🧑  作者: Mango

代码示例1
ext{
    mapstructVersion = "1.2.0.Final"
}
dependencies{
    // ...
    // --- Mapstruct ---------------------------------
    compileOnly("org.mapstruct:mapstruct-jdk8:${mapstructVersion}")
    annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
}
compileJava {
    options.annotationProcessorPath = configurations.annotationProcessor

    // if you need to configure mapstruct component model
    options.compilerArgs << "-Amapstruct.defaultComponentModel=spring" 
}