Questions tagged [jaxb2-maven-plugin]

This plugin uses JAXB2 to generate Java classes from XML Schemas (and binding files) and to create XML Schemas for existing Java classes.

The Java Architecture for XML Binding (JAXB) enables translation between Java classes and XML documents. JAXB2 is specified by JSR-222.

The JAXB-2 Maven Plugin requires Maven 2+ and JDK 1.5+ and makes use of the JAXB Binding Compiler (xjc)

The plugin defines two main goals (see official documentation for more goals)

  • jaxb2:xjc - runs the xjc compiler to generate Java classes from XML Schema(s) and binding file(s)
  • jaxb2:schemagen - generates XML Schemas from JAXB annotated Java classes
173 questions
2
votes
0 answers

How to set version of schema using jaxb2-maven-plugin when generating xsd with SchemaGen?

This is my plugin: org.codehaus.mojo jaxb2-maven-plugin schemagen
2
votes
1 answer

Where is org.codehaus.mojo:jaxb2-maven-plugin 2.0?

I am currently using the JAXB-2 Maven plugin developed by Codehaus (jaxb2-maven-plugin) to generate Java classes from an XSD. The site mentions that the plugin is in version 2.0 (Last Published: 2015-02-09). However, I can not find this plugin on…
Tunaki
  • 132,869
  • 46
  • 340
  • 423
2
votes
1 answer

Jaxb Generates Objects for Unused Elements from Imported Schema

I have several schemas that inherit one or more elements from a collection of 'common' schemas. In this particular instance, I'm importing one of these schemas to make use of a single complex type defined in it. When I generate the java objects from…
JHarnach
  • 3,944
  • 7
  • 43
  • 48
2
votes
3 answers

xjc or jaxb2-maven-plugin or maven: weird behavior while compiling XSDs, processing files twice but with altered names?

Not sure where the issue is here; I suspect XJC but it's been driven by the jaxb2-maven-plugin within maven, so there's a couple of layers to unpack. I'm compiling a folder of XSDs and it seems to be processing each file twice, once with the actual…
denishaskin
  • 3,305
  • 3
  • 24
  • 33
2
votes
1 answer

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

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: org.codehaus.mojo
reto
  • 9,995
  • 5
  • 53
  • 52
2
votes
0 answers

JAXB-2 Maven Plugin and maxOccurs=5000 limitation

I'm using the JAXB-2 Maven Plugin to generate classes from an XSD. One element has a maxOccurs of 50000 so the secure processing feature causes an exception for violating the 5000 limit. Changing the XSD is not an option so as a workaround I added…
Oli
  • 830
  • 7
  • 20
2
votes
0 answers

Can't get jaxb-facets working with jaxb2-maven-plugin (java 6)

I'm trying to generate schema files from java classes with maven using the jaxb2-maven-plugin under java 6. Generally it works fine. But additionally I'am using the jaxb-facets fork in order to support the full schema features. Generally…
2
votes
1 answer

Not able to generate annotation through maven jaxb plugin

I am trying to add javax.persistence.Id as an annotation to a filed and generate as Java objects through Maven JAXB plugin. However I run into class not found exception for javax.persistence.id I did make sure that the javax.persistence is included…
lazyguy
  • 963
  • 1
  • 13
  • 33
1
vote
0 answers

Runtime error due to @XmlJavaTypeAdapter not being resolved

I am using jaxb2-maven-plugin to generate Java classes from an XSD file. I have a bindings file with adapters for XML date elements that point to a fully qualified java class (e.g: com.example.project.DateAdapter). When I run mvn clean install I see…
1
vote
0 answers

JAXB2 Maven Plugin ignores specified element names and file name when generating XSD file

I want to generate an XSD file from a Java file using the JAXB2 Maven plugin. But JAXB generates a file that ignores the names specified in the @XmlElement annotations and does not rename the file. Instead it just says "[WARNING]…
xgb84j
  • 519
  • 2
  • 8
  • 19
1
vote
0 answers

jaxb2-maven-plugin Jakarta cd:date binding

I have an xsd file, jaxb class generation is ok
1
vote
1 answer

com.sun.tools.xjc.maven2 giving No XSD files found even though xsd exist (java 11)

I am upgrading from java 8 to java 11. I'm attempting to use jaxb2-maven plugin to convert XSD files into java classes. when i run "mvn clean install" i get the below compile error [INFO] Ignored given or default sources [xsd/dummy.xsd], since it is…
1
vote
1 answer

XJC Generating Java objects on different packages using maven jaxb2 plugin

In my resources folder src/main/resources, I have an xsd folder with subfolders named create and update. So the folder structure looks like…
heisenberg
  • 1,784
  • 4
  • 33
  • 62
1
vote
1 answer

Java classes are not generated from wsdl file using maven-jaxb2-plugin

I'm trying to generate request/response classes using jaxb2-maven-plugin but I'm really struggling with it. I use code below to try and generate the classes but for some reason only thing that is generated is episode file. I tried with downloaded…
Petar
  • 273
  • 1
  • 4
  • 16
1
vote
0 answers

No implicit JAXBElement conversion using Mapstruct with JAXB generated classes (for intermediate elements both nillable AND optionnal)

I have problems mapping data from JAXB generated classes (using jaxb2-maven-plugin, based on a XSD) to a simple DTO, using Mapstruct. In general, everything works fine, but I have problems in specific situations : my XML element is BOTH nillable…
TooLiPHoNe.NeT
  • 479
  • 1
  • 5
  • 22