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
28
votes
7 answers
How to specify javax.xml.accessExternalSchema for the JAXB2 Maven plugin
I have a maven plugin (jaxb2) and I need to supply a jvm arg to it. I don't think there is a tag to add jvm args in the pom for it.
I know I can pass in jvm args on the command line eg: mvn clean install -Djavax.xml.accessExternalSchema=all
Is it…

Josh
- 818
- 2
- 16
- 27
25
votes
5 answers
Is there a way to deal with duplicate element definitions across multiple .xsd files in JAXB?
I have dozens and dozens .xsd files that I want to auto-generate code for. A couple of the files have duplicate names that clash when I try to generate all of them at the same time.
I am focusing on just trying to get 2 of these to work.
When I…
user177800
24
votes
4 answers
java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
I am trying to update my SpringBoot maven project to Java 17.
17
17
I had working maven-jaxb2-plugin plugin defined which created java classes…

victorio
- 6,224
- 24
- 77
- 113
23
votes
5 answers
How does one get JAXB-generated sources onto the Eclipse build path under m2e/Indigo?
Under Helios/m2eclipse, when I generated jaxb sources they would be put on the Eclipse source path when I did an "Update Project Configuration".
This doesn't happen with Indigo/m2e (initial release of 22 June 2011). What do I need to do to fix…

Ed Staub
- 15,480
- 3
- 61
- 91
22
votes
8 answers
Maven trouble when trying to generate from WSDL file
Im trying to generate sources from a wsdl file, but I keep running into an error on my pom.xml that I believe might be my issue? Below is the error that I get from my pom, and my pom file. Also I cannot build the project with "mvn clean install". I…

javawocky
- 899
- 2
- 9
- 31
17
votes
2 answers
Create a common xsd generated class to be used by other packages
I am trying to use the same generated class but in separate packages. So the structure should look something like this:
com.test.common
-commonType.java
com.test.A
-objectA.java
com.test.B
-objectB.java
But i keep getting…

Matt
- 2,803
- 9
- 33
- 57
17
votes
4 answers
JAXB: How to generate English Javadoc
When I generate JAXB classes using the maven-jaxb2-plugin I get classes with partial(!?) German Javadoc. (My default locale: de_CH)
What I want: English Javadoc
I tried to set the maven opts: -Duser.language=en -Duser.country=US
but it had no…

Puce
- 37,247
- 13
- 80
- 152
14
votes
3 answers
Howto generate classes from WSDL and XSD with gradle, equivalent to maven-jaxb2-plugin
I want to switch my Maven2 build file to gradle.
Generating the java classes from WSDL + XSDs with gradle seems to be not documented further there is no gradle plugin for this.
I use the following configuration with maven and search the equivalent…

Cengiz
- 5,375
- 6
- 52
- 77
11
votes
1 answer
How to generate JaxB-Classes with java.util.Optional?
I use the jaxb2-maven-plugin to generate JaxB-Classes from a given XSD.
It works fine.
But now I want to use java.util.Optional in the generated Classes. But JaxB generated the Classes without the Optionals. So I'm forced to make a Null-Check of…

Mueller2016
- 195
- 1
- 9
11
votes
3 answers
Maven JAXB2 XJC plugin: M2E plugin execution not covered
I am using using the jaxb2 xjc plugin for generating java files from a XSD. Therefore I used to configure my pom.xml as follows:
org.codehaus.mojo
…

Jean Logeart
- 52,687
- 11
- 83
- 118
10
votes
3 answers
Skip the Generated on... in Java files using jaxb2 maven plugin
I'd like to get the maven-jaxb2-plugin to do not write the 'disclaimer':
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.2-hudson-jaxb-ri-2.2-63-
See

ssedano
- 8,322
- 9
- 60
- 98
10
votes
6 answers
Unmarshalling Error: unexpected element (uri:url, local:"objectname"). Expected elements are <{}objectname>
I'm using jaxb2-marshaller to generate classes to communicate with a webservice. Java-classes are generated with use of some wsdl files.
Everything is okay now, but when I'm trying to use some of the generated classes, i got this unmarshalling…

Kornelito Benito
- 1,067
- 1
- 17
- 38
9
votes
0 answers
Migration from maven-jaxb2-plugin 0.14.0 to jaxb2-maven-plugin 2.5.0
Sharing my experience about migrating from
org.jvnet.jaxb2.maven2
maven-jaxb2-plugin
0.14.0
to
org.codehaus.mojo
…

Sándor NÉMETH
- 91
- 1
- 2
9
votes
1 answer
Generate a schema for WSDL with HTTP authentication and the maven-jaxb2-plugin
I want to use jaxb2 plugin to generate a WSDL accessible from a secure URL (basic authentication with user id and password).
Where should I specify the credentials to generate the schema? Without providing them, I get one 401 error during schema…

Swpno
- 173
- 1
- 13