Questions tagged [schemagen]
51 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
- 87,710
- 93
- 269
- 411
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
- 7,158
- 6
- 37
- 57
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
- 3,890
- 2
- 23
- 31
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,282
- 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
- 519
- 4
- 11
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…

Kintsel Dmitry
- 41
- 3
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
- 309
- 1
- 6
- 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
- 7,158
- 6
- 37
- 57
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
- 19,488
- 10
- 62
- 83
3
votes
0 answers
ignore class for jaxb schemagen generation
I have two groups of classes. From the ones in group A I would like to generate an XML Schema using schemagen and the one's in group B I simply want to ignore with regard to the schema generation.
How can I do that?
I only annotated the classes in…

hansi
- 2,278
- 6
- 34
- 42
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,736
- 5
- 28
- 42
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
- 9,683
- 9
- 53
- 71