为什么我的编译错误在添加了jackson-datatype-guava依赖后变成了警告?

问题描述

添加了大约 25 个依赖项,因为它们作为 unused undeclared 依赖项出现在警告中。换句话说,它们总是通过传递依赖而存在,但现在我只是显式地添加它们。

然而,由于这样做,一些生成的类停止生成。这个警告似乎很可疑:

[警告] /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class ):警告:在“ConfiguringAnnotation”类型中找不到注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件 警告:没有处理器声明任何这些注释:/com.google.inject.Provides,java.base/java.lang.Deprecated,/javax.annotation.Nullable,/org.skife.jdbi.v2.sqlobject.sqlBatch,/ com.google.common.annotations.VisibleForTesting,/dagger.Component,/org.jdbi.v3.stringtemplate4.UseStringTemplatesqlLocator,/dagger.Component.Builder,/org.skife.jdbi.v2.sqlobject.Bind,/org.skife .jdbi.v2.sqlobject.customizers.SingleValueResult,/com.google.inject.Singleton,/io.norberg.automatter.AutoMatter,/javax.inject.Singleton,/org.skife.jdbi.v2.unstable.BindIn,/ org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator,/org.skife.jdbi.v2.sqlobject.customizers.Mapper,/javax.inject.Named,/dagger.Provides,/dagger.Module,/javax.inject .Inject,java.base/java.lang.Override,/org.skife.jdbi.v2.sqlobject.sqlQuery,/dagger.BindsInstance,/org.skife.jdbi.v2.sqlobject.sqlUpdate /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class):警告:找不到“ConfiguringAnnotation”类型中的注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件 警告:没有处理器声明任何这些注释:java.compiler/javax.annotation.processing.Generated,java.base/java.lang.SafeVarargs,java.base/java.lang。 SuppressWarnings,/io.norberg.automatter.AutoMatter.Field /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class):警告:找不到“ConfiguringAnnotation”类型中的注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件 /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class):警告:找不到“ConfiguringAnnotation”类型中的注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件

所以我开始二进制剖析——删除一半的依赖项,然后是一半,然后是一半——当我注意到删除

<dependency>
  <groupId>com.fasterxml.jackson.datatype</groupId>
  <artifactId>jackson-datatype-guava</artifactId>
</dependency>

将上述警告推广到此:

[ERROR] 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project ad-account-service: Compilation failure

[错误] /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class ):警告:在类型“ConfiguringAnnotation”中找不到注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件

[ERROR] 警告:没有处理器声明任何这些注释:/com.google.inject.Provides,/org.skife.jdbi.v2 .sqlobject.sqlBatch,/com.google.common.annotations.VisibleForTesting,/org.skife.jdbi.v2.sqlobject。绑定,/org.skife.jdbi.v2.sqlobject.customizers.SingleValueResult,/org.skife.jdbi.v2 .unstable.BindIn,/org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator,/dagger。模块,/javax.inject.Inject,/org.skife.jdbi.v2.sqlobject.sqlUpdate

[错误] /Users/acheong/.m2/repository/org/jdbi/jdbi3-stringtemplate4/3.12.2/jdbi3-stringtemplate4-3.12.2.jar(/org/jdbi/v3/stringtemplate4/UseStringTemplatesqlLocator.class ):警告:在类型“ConfiguringAnnotation”中找不到注释方法“value()”:找不到 org.jdbi.v3.sqlobject.config.ConfiguringAnnotation 的类文件

[错误] 警告:没有处理器声明任何这些注释:java.compiler/javax.annotation.processing.Generated,java。 base/java.lang.SuppressWarnings,/io.norberg.automatter.AutoMatter.Field

[错误] /Users/acheong/src/ad-account-service/ad-account-service/src/main/java/com/spotify/adaccountservice/dagger/PubSubModule.java:[7,43] 错误:包 com.fasterxml.jackson.datatype.guava 不存在

顺便说一句,警告都连接到一行中,而错误在单独的行中,这不是格式错误

我正在(自愿)深入研究依赖地狱,所以我试图了解细节。这里到底发生了什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)