title: error: duplicate class while compiling java project with Gradle containing dagger generated sources
body: <p>I'm building a Java project using Gradle for build the project and Dagger2 as dependency injector. And I'm getting this error:</p>
  
  <pre><code>&lt;path to the class&gt;/MyModule_SourceConnectionDTOFactory.java:12: error: duplicate class: &lt;package&gt;.MyModule_SourceConnectionDTOFactory
  public final class MyModule_SourceConnectionDTOFactory implements Factory&lt;ConnectionDTO&gt; {
               ^
  &lt;path to the class&gt;/MyModule_DestinationConnectionDTOFactory.java:12: error: duplicate class: &lt;package&gt;.MyModule_DestinationConnectionDTOFactory
  public final class MyModule_DestinationConnectionDTOFactory
               ^
  </code></pre>
  
  <p>Java version 1.8
  Gradle version: 5.4.1 (also tried with 4.5.1)</p>
  
  <p>Dagger dependencies:</p>
  
  <pre><code>dependencies {
      annotationProcessor 'com.google.dagger:dagger-compiler:2.17'
  
      compile 'com.google.dagger:dagger:2.17'
      ...
  }
  </code></pre>
  
  <p>Module Class:</p>
  
  <pre><code>@Module
  public class MyModule {
      private final MyConfiguration config;
  
      @Inject
      public MetaStoreModule(MyConfiguration config){
          this.config = config;
      }
  
      @Provides
      @Singleton
      @Named("sourceConnection")
      public ConnectionDTO sourceConnectionDTO() {
          return new ConnectionDTO(config.sourceHost(), config.sourceUser(),
                  config.sourcePassword(), config.sourceDataBaseName());
      }
  
      @Provides
      @Singleton
      @Named("destinationConnection")
      public ConnectionDTO destinationConnectionDTO() {
          return new ConnectionDTO(config.destinationHost(), config.destinationUser(),
                  config.destinationPassword(), config.destinationDataBaseName());
      }
  }
  </code></pre>
  
  <p>Component class:</p>
  
  <pre><code>import dagger.Component;
  
  import javax.inject.Singleton;
  
  @Singleton
  @Component(modules = MyModule.class)
  public interface MyComponent{
      @Named("sourceConnection")
      ConnectionDTO sourceConnectionDTO();
      @Named("destinationConnection")
      ConnectionDTO destinationConnectionDTO();
  }
  </code></pre>
  
  <p>If I just have one component annotated with that name, not sure why it is finding a duplicate class</p>