Search code examples
javamavencode-generationdagger-2annotation-processor

FluentFuture Class not found with multiple AnntationProcessor


I am developing a simple Java 8 project with Maven and a custom AnnotationProcessor.

If I use only the Dagger 2.15 or my AnnotationProcessor, it works well, but If I use both of them, maven build will fails with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project MyProject: Fatal error compiling: java.lang.NoClassDefFoundError: com/google/common/util/concurrent/FluentFuture: com.google.common.util.concurrent.FluentFuture -> [Help 1]

I tried to import com.google.common.util.concurrent.FluentFuture class from com.google.guava.guava repository (version r05, 19.0, 24.1-jre), but it has not worked.

Project structure:

  • There is a Maven project, what contains the annotations, and two AnnotationProcessors (one of them validates only, the other generates source code) (Based on this article)
  • There is another Maven project, what uses this project as a dependency. In that I would like to use Dagger 2 for dependency injection (I imported it just like it is in the description in Dagger 2 page).

What can I do?

Thank you for your help!


Solution

  • I downgraded to dagger 2.14.1 and stopped getting that error.