This Maven 2 plugin wraps the JAXB 2.x XJC compiler and provides the capability to generate java sources from schemas.
Questions tagged [maven-jaxb2-plugin]
325 questions
4
votes
1 answer
How can I generate classes from XSD that includes another XSD
I have 2 projects:
xsdproject/
src/main/resources/
a.xsd
b.xsd
implproject/
In implproject I want to generate classes from xsd using maven-jaxb2-plugin.
org.jvnet.jaxb2.maven2
…

wajs
- 299
- 3
- 13
4
votes
1 answer
xsd import from different project, generate java class
I have two projects, A and B. In project A I have common.xsd file where I use cxf-xjc-plugin
to generate java classes which work good. Next, I want to reuse this created files and type difinitions from common.xsd
in main.xsd file in project B…

Unyx
- 97
- 2
- 8
4
votes
1 answer
XmlAdapter not working correctly with newer version of JAXB
I'm executing a Maven Project with the below source
package com.coderplus.jaxb;
import java.util.HashMap;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlJavaTypeAdapter(PropertiesMapAdapter.class)
public class PropertiesMap…

coderplus
- 5,793
- 5
- 34
- 54
4
votes
2 answers
JAXB generates List instead of fields
I'm trying to generate a class with the jaxb maven plugin from the following wsdl:

Rick Slot
- 156
- 1
- 7
4
votes
1 answer
Is there a fix for the jaxb2-maven-plugin:schemagen to work with JDK8?
In JDK 7 jaxb2-maven-plugin produces a warning about apt being removed, it now has in JDK8 and I can not sure how to get the plugin to work with JDK8.
warning: The apt tool and its associated API are planned to be removed
in the next major JDK…

Brett Ryan
- 26,937
- 30
- 128
- 163
4
votes
0 answers
Avoiding Compiler warnings on code generated by xjc
My root question is how to benefit from the 'unchecked generics type' Eclipse compiler warning, but not have the list of those warnings in the Problems view polluted by noise from java classes which are generated from xsd files by xjc (via…

elfdude
- 41
- 2
4
votes
1 answer
Generating and customizing equals/hashcode methods with CXF/JAXB2
I have two classes A and B generated by cxf-codegen-plugin from my WSDL. A inherits from B.
I would like to add common methods like hashCode(), equals()... So, I have the following configuration in my POM:
…

manash
- 6,985
- 12
- 65
- 125
3
votes
1 answer
Running custom JAXB2 plugins using Maven JAXB 2.x Plugin
I would like to generate JAXB Java classes using the Maven JAXB 2.x plugin http://static.highsource.org/mjiip/maven-jaxb2-plugin/generate-mojo.html
To declare the custom JAXB plugins I would execute during the generate process, I used the "args"…

nadouani
- 115
- 1
- 3
- 8
3
votes
0 answers
How to generate Java classes from RELAX NG schema
I was trying to implement automatic marshalling and unmarshalling for OPDS directories in Java. I've tried to use Trang to generate .xsd files and then generate Java classes using JAXB2 maven plugin, but the generated XML Schema files were…

Mikhail Yevchenko
- 129
- 1
- 12
3
votes
1 answer
Auto name resolution for jaxb plugin
Is there anyway to do auto name resolution here. I don't want static classes hence using the bindings. but I am getting errors when generating pojo
[ERROR] file:/C:/Projects/custom-mapping/transformer/src/main/resources/xsd/input2.xsd…

Sajin Surendran
- 248
- 6
- 17
3
votes
1 answer
SAXParseException: maven jaxb2 plugin seems not to import schemas correctly
during generation of source from XSD schemas I get a SAXParseException (see below). A schema "gws-ctsa-myapp.xsd" is importing two basic components "gws-services-types.xsd" and "gws-ctsa.xsd". The last one imports as well the same basic component…

Pedro L. Bona
- 31
- 2
3
votes
1 answer
generate java classes from xsd importing other xsd from jar provided via catalog
I have some XSD where some share common definitions. I separated this common definitions into a separate XSD. So far I imported this common.xsd via relative paths across the projects. Thsi worked because all projects kived in the dame SCM…

Timothy Truckle
- 15,071
- 2
- 27
- 51
3
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
- 173
- 3
- 11
3
votes
1 answer
How to generate java classes from multiple xsd with common schema using maven
I'm trying to generate a java classes from multiple xsd files.
But I get this error.
org.xml.sax.SAXParseException; ... 'somelement' is already defined
I think it's due to the common types that included multiple times.
How can I generate the java…

user311633
- 173
- 3
- 11
3
votes
1 answer
What Maven2 plugins are available for JAXB2?
I'd like to generate Java source code from an XML Schema file using JAXB2 via a Maven2 plugin (as in this blog post).
There seem to be 2 Maven plugins for JAXB: The "Maven 2 JAXB 2.x Plugin" (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin) is hosted at…

otto.poellath
- 4,129
- 6
- 45
- 60