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-maven-plugin not renaming xmls and generated xsd doesnt contain namespace

I am trying to generate xsd out of java objects that are annotated with jaxb annotations. When executing the schemagen its generating xsd but it doesnt rename it and no namespace exists. During maven install execution, I see an warning from the…
Rajan
  • 124
  • 2
  • 12
0
votes
0 answers

Not able to generate java stubs from .wsdl files using jaxb-runtime 4.0.3 and maven-jaxb2-plugin 0.15.3

I am using Java 17. It works fine if I use jaxb-runtime 2.3.3 and maven-jaxb2-plugin 0.14.0. I need to upgrade to jaxb-runtime 4.0.3. In .xjb I have replaced all javax.xml.bind.annotation.XmlRootElement by jakarta.xml.bind.annotation.XmlRootElement…
0
votes
0 answers

No adapter endpoint error when calling SOAP service

I have received a wsdl from a client for which I need to create a SOAP service. The Request message is defined as below ->
spartan712
  • 37
  • 5
0
votes
1 answer

SAXParseException: '' is already defined: how to generate Java code using JAXB2 Maven Plugin from conflicting XSD definitions?

I have two XSD documents over which I have no control - i.e. I cannot force their authors to change them. Unfortunately, the XSDs are not valid when used side by side, because they contain conflicting definitions:
Andy
  • 1,127
  • 2
  • 12
  • 25
0
votes
1 answer

jaxb2-maven-plugin:3.1.0:xjc Java 8 - Java 11 Migration Issues

I am currently working on java 11 migration project where jaxb2-maven-plugin has been used for XJC task. Post migration to JDK 11 version, I am getting below mentioned errors. [ERROR] Failed to execute goal…
Babu
  • 440
  • 5
  • 23
0
votes
1 answer

JAXB XJC: how to resolve XSD to Java property conflicts?

I'm trying to generate Java classes starting from an XML Schema Definition but I'm getting an error about a Property "Lang" is already defined. [ERROR] http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd [302,52] com.sun.istack.SAXParseException2:…
1Z10
  • 2,801
  • 7
  • 33
  • 82
0
votes
0 answers

How do I resolve syntax error when using jaxb2-maven-plugin to generate xsd files from Java files with java annotations?

I'm trying to generate XSD files from my java project with the jaxb2-maven-plugin. When doing this i get a syntax error referencing pieces of code where there are java notations like @Nonnull or @Nullable. Im using the jaxb2 maven plugin to generate…
kasder
  • 11
  • 2
0
votes
0 answers

Two declarations cause a collision in the ObjectFactory class

I have xsd specification from external source without option to change anything. There are two elements inside like this:
trzeci
  • 61
  • 1
  • 5
0
votes
0 answers

How to configure codehaus.mojo jaxws-maven-plugin:wsimport to access ssl-protected WSDL

Using Spring Initializer adding only one dependency "Spring Web Service", I created a spring boot maven project as SOAP Web Service Client. I try to use mojohaus/jaxb2-maven-plugin to generate client artifacts from WSDL which is ssl protected. Below…
ITMan
  • 1
  • 1
  • 1
  • 2
0
votes
0 answers

Jaxb2 generate class with constructor with more than 270 fields

my complexType has lots of elements. During build it fails on this error: .java:[1063,12] too many parameters I have in pom.xml this: -Xannotate -Xfluent-api
0
votes
0 answers

xsd conflict when using jaxb2-maven-plugin

I'm trying to revive a legacy project for my client. The project is pretty old and it uses the jaxb2-maven-plugin to generate some java classes from an xsd schema file. org.codehaus.mojo
Ionut
  • 103
  • 9
0
votes
0 answers

JAXB generated code from wsdl cant unmarshalled request because of missing @XmlRootElement annotation

I use this manual to generate code for calling soap webservice in a Springboot project with a different wsdl file. I copy generated source into 'util.pbn' package of my project but when I run my program I face to this…
MTB
  • 405
  • 1
  • 5
  • 12
0
votes
1 answer

JAXB require boolean

I am trying to generate a XSD file with a boolean element that is always required. When I use the XSD file to generate the java classes (with JAXB) the field is not required. I have attempted the following versions:
mop
  • 73
  • 1
  • 9
0
votes
1 answer

JAXB-2 Maven Plugin : package-info is ignored

I have a module in my intellij IDE, which have its own maven project structure (src/main/java, src/main/test). In this project, I coded in a package JAXB classes (java). Then in this package, I have my package-info used normally, by the schemagen…
François F.
  • 229
  • 2
  • 17
0
votes
1 answer

How to fix Camel Jaxb unmasharlling problem

I created a xsd and used it with jaxb plugin like bellow: