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

\org\glassfish\jaxb\jaxb-xjc\2.3.2\jaxb-xjc-2.3.2.jar!\META-INF\versions\9" is not a valid file name: {1}: Invalid file path ->

I have a Maven 3 build issue. Maven is mvn -v Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: D:\Java\apache-maven-3.8.6 Java version: 11.0.15, vendor: Oracle Corporation, runtime: D:\Java\jdk-11.0.15 Default locale: en_US,…
Eljah
  • 4,188
  • 4
  • 41
  • 85
2
votes
0 answers

XJC - Add Lombok Annotation on top of every Generated XSD class and remove Setters Getters

I am working on jaxb2-maven-plugin, I am generating Java POJOs from XSD. I need to add @Data annotation on top of the class without setters getters. The output file should look like this. @Data public class Employee { @JsonProperty("name") …
Pradeep Charan
  • 653
  • 2
  • 7
  • 28
2
votes
0 answers

Alternatives to org.jvnet.jaxb2_commons:jaxb2-basics

I need to generate Java classes using XJC plugin (in gradle) with toString implementation. I am using org.jvnet.jaxb2_commons:jaxb2-basics library, however this needs to be added as a runtime dependency to work since the plugin is actually adding a…
maheeka
  • 1,983
  • 1
  • 17
  • 25
2
votes
2 answers

How to exclude generating of episode file in jaxb2-maven-plugin version 2.5.0?

I use the xjc goal of the jaxb2-maven-plugin to generate Java classes from a set of xsd files. A minimal, complete and verifiable example would be a Maven project with the following pom.xml file:
Magnilex
  • 11,584
  • 9
  • 62
  • 84
2
votes
1 answer

Jaxb2-maven-plugin Error java11 schema_reference

I have an error when running the jaxb2-maven-plugin (2.5.0) with JDK11. pom.xml : org.codehaus.mojo jaxb2-maven-plugin
E Kh
  • 105
  • 9
2
votes
2 answers

Spring boot - Server did not recognize the value of HTTP Header SOAPAction

I want to consume soap service using jaxb. The generated request from jaxb is
Developer404
  • 5,716
  • 16
  • 64
  • 102
2
votes
1 answer

SOAP Request Mapping using ModelMapper

I am trying to map a SOAP request to a Java POJO using org.modelmapper.ModelMapper But, its not working due to the structure of the source, it has a list of strings .... Below is the snippet for the 3 main components source soap message, destination…
Mega
  • 1,304
  • 5
  • 22
  • 37
2
votes
1 answer

Maven JAXB2 plugin fails to process bindings file

How to make it recognize bingings file and then generate java classes from wsdl? pom org.springframework.boot
J.Olufsen
  • 13,415
  • 44
  • 120
  • 185
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…
Aman Gupta
  • 5,548
  • 10
  • 52
  • 88
2
votes
1 answer

how can JAXB2 directly use WSDL url instead of .WSDL file

I have installed the JAXB2 maven plugin in my project. The .WSDL file which generated from my SOAP WebService is located in the project directory, But I want JAXB2 to directly use WSDL URL instead of using the .wsdl file.
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
  • 1,030
  • 2
  • 17
  • 34
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,283
  • 4
  • 28
  • 44
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
2 answers

Error in jaxb2-maven-plugin XJB: The namespace of element 'bindings' must be from the schema namespace'

I am attempting to assign different name spaces to different xsd files and use jaxb2-maven plugin to build the artifacts defined by these xsd files. Maven fails to generate the source with the following error: The namespace of element 'bindings'…
Half_Duplex
  • 5,102
  • 5
  • 42
  • 58
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
  • 22,052
  • 14
  • 85
  • 185