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
152 questions
3
votes
1 answer

Can't use jaxb bindings on individual xsd elements

I'm using jaxb to generate java source code from an xsd file. I want to be able to specify which packages the sources are generated in on a per element basis, however whenever I generate sources I get the following error: [ERROR]…
Edd
  • 7,660
  • 14
  • 44
  • 70
3
votes
1 answer

Marshal not @XmlRootElement with JAXB to String

I need to marshal one JAXB generated object to String. The problem is that it does not have an @XmlRootElement annotation. It is not a root element. The element in XSD looks like this:
Paulius Matulionis
  • 21,481
  • 21
  • 97
  • 139
2
votes
1 answer

JAXB2 Maven Plugin xjc parse error: org.xml.sax.SAXParseException: Unexpected appears

I want to use JAXB2 maven plugin to generate Java Objects from WSDL file to consume a soap service as a client. When I use this plugin as "jaxb2:generate" and configuration below: ...
2
votes
0 answers

Maven Jaxb plugin implClass binding not working

I have a class Task that was generated by the jaxb2-maven-plugin using a XML schema. Here is the schema:
Michael Pacheco
  • 427
  • 6
  • 14
2
votes
0 answers

How to bind schema with jaxb2 for duplicated element name

I'm trying to generate a java classes from multiple xsd files. In these schemas files there are multiple complexType or elements with the same name in different schemas. Please note that I'm unable to change the schemas. I created a binding file,…
user311633
  • 123
  • 1
  • 10
2
votes
1 answer

Jaxb2 maven plugin getting error when generating xsd from complex classes

I have a case that i have 35 classes that some of them related with each other inside of them. Such as; Addendum.java @XmlType(name="addendum",namespace=…
boraer
  • 319
  • 4
  • 11
2
votes
0 answers

Generate XML schema from Kotlin Enum using Jaxb

I would like to use some XML schema files from Kotlin enum classes. When I generate classes from an xml schema, this is the output: import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** *

Java class for…

Johan Vergeer
  • 4,153
  • 7
  • 36
  • 81
2
votes
0 answers

Spring OXM: Managing namespace with jaxb2 marshaller for different schema

How to manage the namespace prefix as per XSD used for generating XML ? I have 3 different XSD files, using maven jaxb2-maven-plugin, I am able to generate Java classes as well. but I am not able to generate XML file with specific namespace prefix…
agpt
  • 4,887
  • 9
  • 45
  • 85
2
votes
1 answer

jaxb2-maven-plugin - how to turn off recursive directory traversal when generating xsd from classes

I am using jaxb2-maven-plugin for generating XSD from jaxb annotated classes. The configuration looks like that rest-api-execution-schemagen schemagen
mdzh
  • 897
  • 1
  • 13
  • 30
2
votes
1 answer

Maven duplicate class with generated sources when using -f option

I try to build a Maven project with classes generated from jaxb2-maven-plugin. Consider the following minimal pom.xml:
SilverNak
  • 3,017
  • 4
  • 24
  • 33
2
votes
1 answer

Unable to parse WSDLs into different packages with jaxb2-maven-plugin

I have configured my jaxb2-maven-plugin to pick up the WSDLs from different folders under same location and parse them into different packages as the functionality they deliver is different. On running mvn install, only the first wsdl is processed…
Sai Raju
  • 21
  • 1
2
votes
1 answer

How to detect when two linux paths refer to the same file in maven?

I have a maven project in which jaxb2-maven-plugin (mojohaus one) is used to generate sources. When invoked on Jenkins, it fails due to all generated classes being duplicated. After some investigations, I could track it down to this configuration in…
Riduidel
  • 21,048
  • 12
  • 78
  • 165
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
  • 116,530
  • 39
  • 281
  • 370
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,754
  • 6
  • 38
  • 45
1 2
3
10 11