MapStruct implementation is not working in Spring Boot Web Application

前端 未结 5 1766
醉话见心
醉话见心 2021-02-06 13:07

I am a newbie to Spring Boot and MapStruct Tool.

Earlier, A Project(written by other team using these technologies) is not starting up. Then, I had made some changes i

5条回答
  •  面向向阳花
    2021-02-06 14:00

    In my case, I believe the error was due to an incomplete build.gradle.

    Before

    dependencies {
        compile group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.2.0.Final'
    }
    

    After

    apply plugin: 'net.ltgt.apt'
    
    dependencies {
        compile group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.2.0.Final'
        compile group: 'org.mapstruct', name: 'mapstruct-jdk8', version: '1.2.0.Final'
        apt 'org.mapstruct:mapstruct-processor:1.2.0.Final'
    }
    
    
    buildscript {
        repositories {
            mavenCentral()
            maven {
                url "https://plugins.gradle.org/m2/"
            }
        }
        dependencies {
            classpath("net.ltgt.gradle:gradle-apt-plugin:0.9")
        }
    }
    

    Ensure you have configured your build.gradle properly, as described in the docs.

提交回复
热议问题