[英]Bazel build with Jackson annotations for ser/Deser and generate Java classes
So, we have been trying to xploring bazel as a build system for our organization, since we have a huge monorepo. 因此,由于我们拥有庞大的monorepo,我们一直试图将bazel作为我们组织的构建系统。 One of the problems I'm facing is, we have some code-gen classes which use Jackson's annotation processors to generate immutable copies of some file types.
我面临的问题之一是,我们有一些代码生成类,它们使用Jackson的注释处理器来生成某些文件类型的不可变副本。
Eg : 例如:
@JsonSerialze
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Value.Immutable
@JsonDeserialize(as=ImmutableABC.class)
Public abstract class ABC {
...
}
So, for this , I include a java_plugin tag in bazel build file for this module as follows : 因此,为此,我在此模块的bazel构建文件中包含一个java_plugin标记,如下所示:
Java_plugin(
name="abcgen",
srcs=["src/.../ABC.java"],
Deps=[ {jackson-deps go here}],
processor_class = "org.immutables.processor.ProxyProcessor",
)
This always fails , saying cannot find the ImmutableABC.class file which is referenced in the annotation. 这总是失败,说找不到注释中引用的ImmutableABC.class文件。 Any ideas?
有任何想法吗? Am I missing the processor class for the Jackson annotations, and also is it possible to include multiple processor classes?
我是否缺少Jackson注释的处理器类,并且是否可以包括多个处理器类?
对于遇到此类问题的任何人,请确保您的插件的generates_api = 1,如果在库中使用了生成的类(对于杰克逊部分而言),那实际上不是问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.