Questions tagged [schemagen]

44 questions
14
votes
2 answers

Generating XSD schemas from JAXB types in Maven?

I'm trying to basically generate XSD schemas from my model classes annotated in JAXB using a Maven plugin. Here's the relevant code in my POM: com.sun.tools.jxc.maven2
Naftuli Kay
  • 75,812
  • 80
  • 244
  • 374
8
votes
3 answers

Is it possible to get maven-jaxb-schemagen-plugin working with Java 7?

When I try to use maven-jaxb-schemagen-plugin with java 7 com.sun.tools.jxc.maven2 maven-jaxb-schemagen-plugin 1.2 I get an error: [ERROR] Failed to execute goal…
lexicalscope
  • 6,370
  • 6
  • 34
  • 56
6
votes
3 answers

How do you invoke schemagen in Java 11?

According to Oracle documentation the schemagen tool is removed from the JDK as part of JEP 320 (http://openjdk.java.net/jeps/320). That JEP points to Maven artifacts that now supply the missing tools. The coordinates of the artifacts are wrong in…
swpalmer
  • 2,118
  • 17
  • 23
6
votes
1 answer

JAXB schemagen doesn't reference classes in episode file

I am actually using a schema first approach, however I hit a roadblock with the "ominous" JAXB Map problem! and worked around it by switching to a code first approach for this one. Now I'd like to reuse this type in other modules and continue my…
Mirko Jahn
  • 1,262
  • 1
  • 9
  • 15
5
votes
1 answer

ClassCastException in ant schemagen task using jaxb-ri-2.2.7

I'm trying to use the schemagen ant task from JAXB-RI 2.2.7, but I keep getting "BUILD FAILED .... Error starting ap" on the schemagen task in build.xml. The relevant stanzas are as follows:
AdamF
  • 385
  • 3
  • 8
5
votes
1 answer

prevent schemagen from adding the super-class to the schema?

how do i prevent schemagen from adding the super-class to the schema? I have tried using XMLTransient on the super-class, and on its fields but they still show up in the schema . for example : @XmlTransient public class Asset { @XmlTransient …
shay
  • 51
  • 1
5
votes
1 answer

schemagen.exe generates xsd schema with non-determined order of

I used org.codehaus.mojo jaxb2-maven-plugin to generate xsd schema for my classes. Plugin site http://mojo.codehaus.org/jaxb2-maven-plugin/faq.html tell, that plugin uses JDK utility schemagen.exe to do generation. Problem is that order in…
Dmitry
  • 61
  • 1
4
votes
1 answer

JAXB JXC generates schema for enums regardless of @XmlTransient

Using the JXC schema generation ant task, I can't seem to get it to ignore an enum. I have several enums that are used internally to denote type or minor configuration values that are not relevant to the generated XML. I can exclude the field using…
bcowdery
  • 170
  • 4
4
votes
1 answer

JAXB schemagen how generate choice for two fields?

I have java class: public class ActivityAddress { @XmlElement(name = "Elem1", required = false) private String elem1; @XmlElement(name = "Elem2", required = false) private String elem2; @XmlElement(name = "PostIndex", required…
4
votes
2 answers

Generate jaxb Xsd schema for class files from a jar

I would like to generate jaxb xsd schema from class files in jar. Currently, I am using jaxb2-maven-plugin to generate schema using java files. org.codehaus.mojo
White Roses
  • 279
  • 1
  • 5
  • 16
3
votes
1 answer

control schema file name created by jaxb schemagen maven plugin (maven-jaxb-schemagen-plugin)

I don't seem to be able to work out how to get control the file name of the XSD file created by maven-jaxb-schemagen-plugin. The documentation is a bit sparse. com.sun.tools.jxc.maven2
lexicalscope
  • 6,370
  • 6
  • 34
  • 56
3
votes
1 answer

Generating XML Schema from JAXB class files in Ant

Is it possible to use the shemagen ant Task to generate an xsd schema from class files instead of from source?
Stephen
  • 18,322
  • 10
  • 57
  • 80
3
votes
1 answer

JAXB SchemaGen with Enums in a different package

How do you generate a schema from JAXB Objects that reference enums in a different package? Below is an example: Enum Class package com.example.one public enum EnumExample { VALUE_ONE VALUE_TWO } JAXB Class package com.example.two public…
lucasweb
  • 1,710
  • 5
  • 26
  • 40
3
votes
1 answer

How to document contract-last (via jaxb schemagen) webservice?

I've developed a webservice and rightfully my users would like to see documentation. I'd prefer to simply document my code, either with javadoc comments or with an explicit annotation, e.g. @XmlComment("This is used to [blah…
inanutshellus
  • 8,481
  • 9
  • 48
  • 69
2
votes
2 answers

SchemaGen wrongly generates unnecessary association tables

I have a very simple DB schema, the classic Order ---(one to many)---> OrderItem <---(many to one)--- Product However when I use SchemaGen to generate the DDL it creates an extra layer orders_orders_item, and product_orders_item, in effect adding a…
Oliver Watkins
  • 10,301
  • 19
  • 83
  • 168
1
2 3