title: Cannot find symbol class "Generated" for Dagger 2
body: <p>I just started doing dependency injection using <code>Dagger 2</code>. When I spun up my <code>modules</code>, <code>components</code> and tried to build my application, <code>gradle</code> threw the error </p>
  
  <p><code>Error:(4, 24) error: cannot find symbol class Generated</code></p>
  
  <p>I dug into it and found that the error is in one of the classes <code>Dagger</code> generates to do <code>DI</code>. The particular class that's missing was <code>javax.annotation.Generated</code> and the line throwing the error is the line that anntotates a <code>Dagger</code> generated class as <code>@Generated("dagger.internal.codegen.ComponentProcessor")</code></p>
  
  <p><a href="https://stackoverflow.com/questions/27529563/autovalue-cannot-find-symbol-class-generated-error">This</a> question helped in finding the solution which is to add the <code>javax</code> package as a dependency by adding the line <code>compile 'org.glassfish:javax.annotation:10.0-b28'</code> to my gradle build file. This led to a successful build.</p>
  
  <p>My question is, why is that not added as a transitive dependency for <code>Dagger</code> or why hasn't anyone else faced this particular issue (I assume so, since I couldn't find any question here regarding this?</p>