title: MapStruct with Gradle and eclipse is not working
body: <p>Created gradle application using SpringBoot with MapStruct. </p>
  
  <p>Build.gradle file has following entry.</p>
  
  <pre><code>dependencies {
      compile "org.mapstruct:mapstruct-jdk8:${mapstructVersion}"
      testCompile 'org.testng:testng:6.10', 'org.easytesting:fest-assert:1.4'
      compile "org.mapstruct:mapstruct-processor:${mapstructVersion}"
  }
  
  plugins {
      id 'java'
      id 'net.ltgt.apt-eclipse' version '0.18'
  }
  </code></pre>
  
  <p>Mapper class</p>
  
  <pre><code>@Mapper(componentModel="spring")
  public interface SourceTargetMapper {
  
      SourceTargetMapper INSTANCE = Mappers.getMapper(SourceTargetMapper.class);
  
      @Mapping(source = "qax", target = "baz")
      @Mapping(source = "baz", target = "qax")
      Target sourceToTarget(Source source);
  
      @InheritInverseConfiguration
      Source targetToSource(Target target);
  }
  </code></pre>
  
  <p>Impl file is created under build folder but while running the code getting the error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.ExceptionInInitializerError  at org.mapstruct.example.app.main(app.java:7) Caused by:
    java.lang.RuntimeException: java.lang.ClassNotFoundException: Cannot
    find implementation for org.mapstruct.example.SourceTargetMapper  at
    org.mapstruct.factory.Mappers.getMapper(Mappers.java:68)  at
    org.mapstruct.example.SourceTargetMapper.(SourceTargetMapper.java:29)
      ... 1 more Caused by: java.lang.ClassNotFoundException: Cannot find
    implementation for org.mapstruct.example.SourceTargetMapper   at
    org.mapstruct.factory.Mappers.getMapper(Mappers.java:85)  at
    org.mapstruct.factory.Mappers.getMapper(Mappers.java:65)</p>
  </blockquote>
  
  <p>If I move Impl file from Build folder bin folder it works fine. It means MapStruct create the implementation file under build folder and trying to access it from bin folder.</p>
  
  <p>How to change the location of build files to bin folder?</p>
  
  <p>Working fine with Maven project with M2e plugin but not with gradle.</p>
  
  <p>Build.gradle file after the change suggested.</p>
  
  <pre><code>    plugins {
      id 'java'
      id 'net.ltgt.apt-eclipse' version '0.18'
  }
  
  repositories {
      mavenCentral()
      mavenLocal()
  }
  
  task wrapper(type: Wrapper) { gradleVersion = '3.4' }
  
  ext {
      mapstructVersion = "1.2.0.Final"
      javaLanguageLevel = '1.8'
      generatedMapperSourcesDir = "${buildDir}/generated-src/mapstruct/main"
  }
  
  sourceCompatibility = rootProject.javaLanguageLevel
  
  sourceSets.main {
      ext.originalJavaSrcDirs = java.srcDirs
      java.srcDir "${generatedMapperSourcesDir}"
  }
  
  dependencies {
      compile "org.mapstruct:mapstruct-jdk8:${mapstructVersion}"
      testCompile 'org.testng:testng:6.10', 'org.easytesting:fest-assert:1.4'
      annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
  }
  
  tasks.withType(JavaCompile) {
      options.compilerArgs = ['-Amapstruct.suppressGeneratorTimestamp=true']
  }
  </code></pre>
  
  <p>test { useTestNG() }</p>
  
  <p>But still not working. Please check what is missing.</p>