title: IntelliJ IDE 2018.3 Ultimate + Gradle 5.2.1 AND compileOnly
body: <p>I was about building a gradle 5 project in IDEA. 
  The lombok dependency was set to compileOnly in the build.gradle file and running it resulted in success from command line and IDEA gradle tool as well. </p>
  
  <p>"Funny" fact, that lombok isn't included in Source Sets, so my lombok imports are failing....</p>
  
  <p><a href="https://stackoverflow.com/questions/23152657/gradle-show-version">I googled for it, and in theory since IDEA 2017.2 + Gradle 4 it's a fixed issue, IDEA should pick up compileOnly dependencies as well.</a> </p>
  
  <p>In the reality, it does not work.
  Any Gradle plugin, or idea to solve this issue? :) </p>
  
  <p>Thanks. </p>
  
  <p>ui.:</p>
  
  <p>VERSION 1
  Using <strong>compileOnly &amp; annotationProcessor both for prod code and tests</strong> resulted in</p>
  
  <ul>
  <li>from command-line, gradle is able to run everything with SUCCESS</li>
  <li>from IDEA, it's impossible, imports are failing with lombok</li>
  </ul>
  
  <p>VERSION 2
  Using <strong>compile &amp; annotationProcessor</strong></p>
  
  <ul>
  <li>from command-line, gradle is able to run everything with SUCCESS</li>
  <li>from IDEA, imports are OK, everything is fine</li>
  </ul>
  
  <p><code>dependencies {...compileOnly "org.projectlombok:lombok:${lombokVersion}"
   annotationProcessor("org.projectlombok:lombok:${lombokVersion}")
   testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
   testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}")...}</code></p>
  
  <p><a href="https://i.stack.imgur.com/JM60M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JM60M.png" alt="Source Sets IntelliJ IDEA 2018.3"></a></p>
  
  <p><a href="https://i.stack.imgur.com/NCOx7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NCOx7.png" alt="Idea Import&#39;s failed"></a></p>