mapstruct and gradle configuratoin issue in Intellij IDEA

This works for me

In intellij IDEA go to

File | Settings | Build, Execution, Deployment | Build Tools | Gradle | Runner

Enable Delegate IDE build/run actions. Ref :- https://www.jetbrains.com/idea/whatsnew/#v2016-3-gradle

In build.gradle

buildscript {
    ...    
}
plugins {
    id 'net.ltgt.apt' version '0.9'
}

apply plugin: 'idea'
apply plugin: "net.ltgt.apt"

dependencies {
    ...
    compile 'org.mapstruct:mapstruct-jdk8:1.1.0.Final'
    apt 'org.mapstruct:mapstruct-processor:1.1.0.Final'
}

After Adding this configuration Run your project you can see your generated files in build/generated folder