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
1
vote
0 answers

JAXB - Not able to generate objects for specific XML (provided in details)

I am trying to generate java objects for below XML. Steps followed Created XSD using https://www.liquid-technologies.com/online-xml-to-xsd-converter When I tried to build using "generate source".getting some or the other error. I understand that…
Sridhar Patnaik
  • 970
  • 1
  • 13
  • 24
1
vote
0 answers

Java generated classes using xjc does not generates default no args Constructor

Java classes generated form xsd using the xjx plug don't seem to generate the default no args constructors. The Generated class is missing the default public NewStudent(){} constructor. Any idea how it can be achieved?
Rabbani
  • 29
  • 1
  • 4
1
vote
0 answers
1
vote
1 answer

ATTRIBUTE GROUP - Property "Value" is already defined. Use to resolve this conflict

Problem statement I have defined the following XSD:
Matteo NNZ
  • 11,930
  • 12
  • 52
  • 89
1
vote
0 answers

Unmarshalling Error: unexpected element (uri:"", local:“objectname”)

I'm using jaxb2-marshaller to generate classes to communicate with a webservice. Java-classes are generated with use of wsdl files. I consume some operations without problems, but with one in a specific scenario where the response don't has the…
1
vote
0 answers

Getting error while generating jaxb classes in java11

Build is the maven plugin code i used in pom.xml.This I have modified for 2.2 version. org.codehaus.mojo jaxb2-maven-plugin
VIPUL
  • 13
  • 6
1
vote
1 answer

jaxb2-maven-plugin: Can't generate sources from WSDL

I am trying to generate java classes from a wsdl using jaxb2-maven-plugin: org.codehaus.mojo jaxb2-maven-plugin 2.3.1
Gonzalo Santiago
  • 338
  • 3
  • 16
1
vote
1 answer

Most elegant way to make an XSD attribute accept two types (xs:string and xs:long)?

I have received a specification for a SOAP service where the request that I'm sent will contain the following:
Matteo NNZ
  • 11,930
  • 12
  • 52
  • 89
1
vote
1 answer

jaxb2-maven-plugin not generating package-info.java

for all given XSDs, the jaxb2-maven-plugin does not generate the package-info.java file. (it only generates the classes). We still use Java 1.8 My pom looks like this: org.codehaus.mojo
Walter Kuhn
  • 479
  • 1
  • 6
  • 19
1
vote
1 answer

Generate Java from multiple xsd files with xjc

Enviroment I've multiple ant tasks where each of them generates the java code from one XSD for different packages. All tasks are always executed but one after another. Within those xsds some elements may be defined multiple times but just once per…
Jan
  • 1,004
  • 6
  • 23
1
vote
0 answers

how can i bind my schema file using jaxb2-maven-plugin customized binding in the following way

Below is a binding file which is successfully binding the element named NameList in the following schema file to the type List, but i want it to bind it to type List how can i do so? Binding File--
Mohd Insha
  • 11
  • 2
1
vote
1 answer

Jaxb2 maven plugin : Sources vs SchemaDirectory

I am making a maven project that will make use of Jaxb2-maven-plugin to generate java files out of xsd files. My Project structure is like: project.basedir --src/main/resources/schemas ----common ----request ----response Below is the plugin config…
suvojit
  • 311
  • 1
  • 6
  • 18
1
vote
0 answers

How to register XmlAdapter when using episodes with maven-jaxb2-plugin

I have 3 XSDs: commonClasses, and 2 others which import this ones. Now I use maven-jaxb2-plugin to generate my classes from these. To prevent my Enums classes from being generated twice I added: true
Kristof Plennings
  • 469
  • 1
  • 6
  • 17
1
vote
1 answer

org.codehaus.mojo.jaxb2-maven-plugin: binding settings being ignored when using multiple source in pom

There are multiple source xsd defined for code generation and it seems to be a length restriction for source paths. If I remove the comments to add the source tag the code generation complains about too much enum constants and fails. For solving…
Marc Stroebel
  • 2,295
  • 1
  • 12
  • 21
1
vote
1 answer

maven jaxb plugin, java packages generated has mis-match with XSD namespace

Background: I am trying to convert WSDL/XSD to Java classes Issue: package names generated is mismatching with the namespace. Last part of number namespace is missing, below 02 is missing from package XSD has -…
Luke
  • 11
  • 2