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
0
votes
0 answers

Jaxb2 can't find xsd schemas on relative path

I have XSD schema importing another schema, the import looks something like this: It only works like this,…
J H
  • 1
  • 1
0
votes
2 answers

JAXB2 Import: Could not process schema files (in28minutes udemy)

I get a "could not process schema files" error on the line when I try to add the JAXB2 plugin... pom.xml
0
votes
1 answer

jaxb2-maven-plugin not generating sources from wsdl

I have the following configuration for jaxb2-maven-plugin version 2.4 org.codehaus.mojo jaxb2-maven-plugin 2.4
Obb
  • 163
  • 4
  • 12
0
votes
0 answers

How to customize field types from xsd schema generated classes using jaxb binding

I have a schema that generates: public class A(){ int f; int g; } And i wanted the generated class to be: public class A(){ String f; int g; } p.s.: I just want this ("f") specific field to be changed. I've tried using jaxb binding…
0
votes
1 answer

Generate Java Classes from XSD with default package name and XSD namespace

I have 2 sets of XSDs, One for Inbound operations and other for outbound operations. Both XSD sets have similar namespace but since are from different sources need to be maintained seperately in the same codeset. Each XSD set has deeply nested…
0
votes
0 answers

JAXB does not generate getter and setter method appropriate. Only have a content List>

My JAXB has generated java class like below:
 * <complexType name="StubCalculationPeriodAmount">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *        …
Rachel
  • 349
  • 1
  • 3
  • 19
0
votes
1 answer

m2e shows error in execution for jaxb2-maven-plugin schemagen goal

I am using maven and the jaxb2-maven-plugin version 2.2 to generate the xsd by calling the goal schemagen. Everything works find both when I run maven from the command line or when I run it within eclipse using m2e. So far so good. Unfortunately, in…
xavipen
  • 229
  • 1
  • 11
0
votes
1 answer

Jaxb Binding with List returned in web service response

I am developing a jax-ws client, I am trying to handle an ArrayList returned as a response, but i had always empty list. Returned list is NOT empty, I am sure that WebService provider is returning data in that list, I checked that using SoapUI.…
Youssefo
  • 1
  • 4
0
votes
0 answers

Can you force JAXB2 Maven plugin to create a Java class from "empty" element?

I have an XSD Schema with the following element: When I run the build (which has a xjc goal for converting the schema to Java sources), a separate class file FooResponse.java is not…
0
votes
1 answer

JAXB 2.1 implement Comparable for the generated Class

Using Jaxb 2.1 to generate java code from .xsd Jaxb2-basics plug-in is used Wants to have generated Class Student to implement Comparable. public class Student implements Serializable, Comparable { ... //bean class... public int…
0
votes
1 answer

Suppressing output when marshalling nil-able elements with jaxb

My code is using a provided XSD that has a a mix of nil-able and not nil-able elements:
0
votes
1 answer

XSD Namespace issue in Java

I have created 2 xsd's with different name spaces and trying to import Customer.XSD into Main.XSD as shown below: Main.XSD:
Rajeswari Reddy
  • 193
  • 1
  • 6
  • 24
0
votes
1 answer

No schemas have been found - Spring Boot WS

I have the next throuble: When I follow the Spring boot WS example with maven, when I follow the steps, after add the xsd file, the guide indicate how to add the plugin to pom.xml file and this automatically turn the xsd file into java class…
iizAck
  • 96
  • 1
  • 8
0
votes
3 answers

Maven : exclude target/generated-sources from compilation

This question, just to be sure my interpretation is correct : I'm using Mojohaus jaxb2-maven-plugin to generate java classes from .xsd files, and by default it puts them in target/generated-sources Now, I want to get track of these classes in source…
Tristan
  • 8,733
  • 7
  • 48
  • 96
0
votes
1 answer

ObjectMapper throws exception: "no single-String constructor/factory method", due to "nillable" attribute? What can be done?

I need help to solve/fix the cause of the following exception... i.e., Can not instantiate value of type [simple type, class javax.xml.bind.JAXBElement] from String value ('2018-02-04'); no single-String…
sairn
  • 461
  • 3
  • 24
  • 58