JAXB generates duplicate ObjectFactory for package already in episode

I use JAXB to create classes for a schema that imports other schemas. I am using maven and have configured the maven-jaxb2 plugin to use dependencies as episodes to skip generation classes for imported schemas.

However, JAXB continues to generate ObjectFactories for imported schemas, which leads to class conflicts and improper runtime behavior.

As a workaround, I use maven-antrun-plugin to clean up these additional files. Is there a better way to avoid this problem?

+4
source share
2 answers

XJC ObjectFactory. XJC. , , maven-antrun-plugin delete, .

- - . , META-INF\sun-jaxb.episode schemaBindings map="false" .

: maven-jaxb2-plugin.

+6

/ ? , . , , @XmJavaTypeAdatper, .

0

Source: https://habr.com/ru/post/1607853/


All Articles