简体   繁体   English

Bazel使用针对ser / Deser的Jackson注释构建并生成Java类

[英]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.

相关问题 杰克逊(Jackson)Ser / Deser:将对象代理到带有不同密钥的ID /从ID代理 - Jackson Ser/Deser: Proxying an object to/from an id w/ a different key RAD 8.5.5和Websphere 8.5-不为Web服务创建* _Deser和* _ser类 - RAD 8.5.5 and Websphere 8.5 - not creating *_Deser and *_ser classes for webservice java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/FilterProvider - java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/FilterProvider Java 8 异常:com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer 没有默认值 - Java 8 Exception: com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer has no default (no arg) constructor Spring 5 MVC JSON ser / deser不尊重属性(但适用于XML) - Spring 5 MVC JSON ser/deser not respecting properties (but works for XML) 使用maven从xsd生成没有注释的java类 - use maven to generate java classes from xsd without annotations Java-使用fastXML和Jackson进行反序列化注释 - Java - Deserialization Annotations with fasterXML and Jackson 如何在Java中构建时使用注释动态生成代码? - How to generate code dynamically with annotations at build time in Java? Jackson:从 XSD 生成 Jackson 类 - Jackson: Generate Jackson classes from XSD 创建.ser文件后,是否可以编辑.ser java文件中使用的类? - Can classes used in .ser java file be edited after .ser file creation?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM