maven-jaxb2-plugin

How to generate JaxB-Classes with java.util.Optional?

百般思念 提交于 2019-12-20 20:36:07
问题 I use the jaxb2-maven-plugin to generate JaxB-Classes from a given XSD. It works fine. But now I want to use java.util.Optional in the generated Classes. But JaxB generated the Classes without the Optionals. So I'm forced to make a Null-Check of every Variable. Did anybody know how the jaxb2-maven-plugin has to be configured to use the java.util.Optional? Thanks for you help! 回答1: Maybe you could find something more generic but i'm not sure if this is possible. Anyway you can still define

JAXB binding multiple files with same namespace to same package

喜你入骨 提交于 2019-12-20 07:22:00
问题 I'm having a schema hierarchy like this: common |---legacy | |---legacy.xsd xmlns="http://common/legacy" | |---other.xsd xmlns="http://common/legacy" | '---....xsd xmlns="http://common/legacy" |---send |---file.xsd xmlns="http://common/send" '---text.xsd xmlns="http://common/send" '---....xsd xmlns="http://common/send" All files in one folder have the same namespace. Now I want to map the namespaces to specific java packages (I cannot change the namespace). I found a solution to bind a schema

how to create common xsd generated java classes

三世轮回 提交于 2019-12-20 06:27:26
问题 I want to generate java classes through XSDs , I want to use/include one XSD file in another but when I include them in another XSDs same java class is generated in both the packages. I am also using maven-jaxb2-plugin plugin 回答1: Do separate - aka modular - schema compilation using so-called episodes . That is to say, if you want to import schema A into schema B and generate classes for schema B, you first create a separate Maven project in order to compile schema A to a separate Maven

JAXB separate episodes with annox customizations fails : SAXParseException2

泄露秘密 提交于 2019-12-20 03:07:43
问题 I have 2 maven modules. First one contains only a xsd schema to generate base POJO classes. Second on contains a xsd schema that imports first one with a catalog file and generate new POJO classes. Both generation works. Now, I add annotations to both xsd files with annox (Swagger annotations). First module compilation succeeded but seconds module compilation fails with and exceptions : [ERROR] Error while generating code.Location : com.sun.istack.SAXParseException2; systemId: jar:file:/C:

maven-jaxb2-plugin VS jaxb2-maven-plugin for multiple schemas

和自甴很熟 提交于 2019-12-19 08:05:07
问题 I have multiple xsd schemas that I want to unmarshall into different packages under the same folder target/generated-sources/xjc . I tried both plugins and both seem to work fine with these 2 configurations but in case of maven-jaxb2-plugin the eclipse plugin keeps generating classes indefinitely (because of the forceRegenerate = true) but if I don't specify forceRegenerate it won't generate the second and third set of classes at all when I run mvn clean package Are there any issues with my

jaxb2 simplify plugin elements not simplified

China☆狼群 提交于 2019-12-13 05:26:16
问题 I have tried to convert XSD to JAXB classes using mave-jaxb2 plugin and jaxb2-basics simplify plugin. The configuration in pom.xml is available in this post sample.xsd (complex choice type) <xs:complexType name="doclist"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="document1" type="type1"> <xs:annotation> <xs:appinfo> <simplify:as-reference-property/> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="document2" type="type2"> </xs:element> </xs

Eclipse error message for jvnet maven-jaxb2-plugin version 0.13.0

杀马特。学长 韩版系。学妹 提交于 2019-12-12 15:31:37
问题 I am trying the sample JAXB Maven project with jvnet maven-jaxb2-plugin from GitHub https://github.com/highsource/maven-jaxb2-plugin/releases. I am using the latest version 0.13.0 and downloaded maven-jaxb2-plugin-sample-jaxbplugins-0.13.0-maven-src.zip I am successful in running the mvn clean install via command line. But when I import it into Eclipse Luna, I got an error message like this: Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.0:generate failed: A required

JAXB2 maven plugin in eclipse shows error

百般思念 提交于 2019-12-12 05:28:21
问题 I'm using JDK 1.6 (due to dependencies) and to generate classes from xsd, I have added maven-jaxb2 plugin as shown below in pom.xml. But the eclipse (Kepler) complains as below. Error parsing the command line [[-Xsimplify, -episode, D:\test\workspace\sample\target\generated-sources\xjc\META-INF\sun-jaxb.episode]] (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.1:generate:jaxb-test:generate-sources) pom.xml <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version>

jaxb episodic compilation with maven

核能气质少年 提交于 2019-12-11 03:35:01
问题 I am trying to execute the maven-jaxb2-plugin-sample-episode-0.7.4 (explained here and with a download available) to try separate schema compilation. Despite it compiles the first schema (A), it fails in the second one (B) because it is not able to resolve the artifact maven-jaxb2-plugin-sample-episode-a-maven:jar:0.7.4. I execute mvn assembly:assembly from the command line (windows) and this is the error I get: ... [INFO] ----------------------------------------------------------------------

jaxb2-maven-plugin generates invalid source for doubles with default value =INF

☆樱花仙子☆ 提交于 2019-12-11 03:05:06
问题 I have a problem where the jaxb2-maven-plugin generates invalid source code when the XSD file contains default values for doubles. I use the jaxb2-maven-plugin (org.codehaus.mojo) version 1.5 : <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId> <version>1.5</version> <configuration> </configuration> <executions> <execution> <id>analysis_jaxb</id> <phase>generate-sources</phase> <goals> <goal>xjc</goal> </goals> <configuration> <clearOutputDir>false<