我正在使用 Maven 和自定义 AnnotationProcessor 开发一个简单的 Java 8 项目。
如果我只使用Dagger 2 .15 或我的 AnnotationProcessor,它运行良好,但如果我同时使用它们,maven 构建将失败并出现以下错误:
[错误] 无法在项目 MyProject 上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile): 编译 fatal error : java.lang.NoClassDefFoundError :com/google/common/util/concurrent/FluentFuture:com.google.common.util.concurrent.FluentFuture -> [帮助1]
我尝试从 com.google.guava.guava
存储库(版本 r05、19.0、24.1-)导入 com.google.common.util.concurrent.FluentFuture
类jre),但没有成功。
项目结构:
- 有一个 Maven 项目,其中包含注释和两个 AnnotationProcessor(其中一个仅验证,另一个生成源代码)(基于 this 文章)
- 还有另一个 Maven 项目,它使用该项目作为依赖项。因为我想使用 Dagger 2 进行依赖注入(inject)(我导入它就像 Dagger 2 页面中的描述一样)。
我能做什么?
感谢您的帮助!
最佳答案
我降级到 dagger 2.14.1 并且不再收到该错误。
关于java - 使用多个 AnntationProcessor 找不到 FluentFuture 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49928077/