Questions tagged [jaxb2-annotate-plugin]
21 questions
9
votes
2 answers
Suppress compiler warnings on JAXB generated classes
This is possibly a duplicate of this question (Avoiding Compiler warnings on code generated by xjc) but since I am not very well versed in XJC/JAXB custom bindings idiosyncrasies, I'll presume I may have misunderstood the mentioned question.
My…

quantum
- 3,000
- 5
- 41
- 56
6
votes
1 answer
JAXB schema to Java Different XmlRootElement name and Class name
I have a xsd schema from which I'm generating some java classes. I'm using jaxb for the generation.
I want to be able to generate a class annotated with @XmlRootElement, but I want the @XmlRootElement name property to be different than the name of…

Paulo Rodrigues
- 593
- 14
- 32
5
votes
1 answer
Modify java classes to include specific annotations at compile time
I have many classes generated by JAXB's xsd2java. I need all these classes to be annotated with specific annotations at compile time (for example with lombok annotations). Is there any way to do this, with some code generation tool for example?

alex
- 705
- 9
- 21
4
votes
1 answer
How to use jaxb2-annotate-plugin with XJC in command line
I'm building java classes based on an xsd using "jaxb-ri" in command line (xjc.bat).
I want to set a namespace in an XmlType annotation using jaxb2-annotate_plugin but I don't know how to add this plugin to xjc classpath and acitvate it.
here is my…

Samy
- 121
- 3
- 9
4
votes
2 answers
jaxb2-annotate-plugin not working
I want to generate "@java.lang.SuppressWarnings("all")" before the generated "Doc" class.
Problem: jaxb2-annotate-plugin don't generate annotations.
My pom.xml:
...
…

Xeddon
- 429
- 8
- 18
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
2 answers
jaxb2-annotate-plugin: Adding annotations to the XJC classpath
Is it possible to add custom annotations to the XJC classpath, while they are defined within my project itself? This when using the maven jaxb2-annotate-plugin.
The problem regards this piece of the documentation:
Annotation classes must be known…

Jaims
- 1,515
- 2
- 17
- 30
2
votes
0 answers
How to use jaxb2-annotate-plugin
I just learned how to generate Java classes from XSD using JAXB (with Maven), now I need to add to my generated classes some annotations. I found out that jaxb2-annotate-plugin does exactly this, but I don't know how to use it in my project.
Can…

Cambiasso
- 113
- 1
- 13
2
votes
1 answer
Custom annotation with jaxb2-annotate-plugin and XJC tool
I'm trying to convert bunch of XSD files to Java source POJOs at runtime. These XML schemas will be generated based on some protocol specific model definitions.
I have used the JAXB's XJC to compile the schema to pojo. Started facing problem when I…

Swaminathan.M
- 283
- 1
- 4
- 10
1
vote
1 answer
JAXB: xsd + xjb to POJO without annotations
I got stuck trying to convert a XSD + XJB file to a POJO that has no JAXB annotations inside its code.
Project structure:
pom.xml
src/main/resources/schema.xsd
The file schema.xsd can be found here as an example.
I am using Maven and the plugin…

joccafi
- 78
- 9
1
vote
0 answers
xjc generates incorrect jaxb annotations for collection of IDREF elements
TL;DR:
The code and annotations generated by xjc + jaxb2-annotate + xew does not produce the desired (or, for that matter, working out-of-the-box) xml structure, which should be a collection of IDREF elements.
If I manually change the jaxb…

linus
- 138
- 9
1
vote
0 answers
JAXB binding to annotate all strings in all schemas under /schema with a custom annotation
I have a dir /schemas that has many .xsd files, and I want to annotate every field of type String with a custom annotation I created.
I'm using this plugin: "org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.4".
I think creating a jaxb binding…

Yaz
- 17,126
- 3
- 16
- 11
1
vote
1 answer
XJC annotation issue
I am trying add deprecated annotation on my xjb generated stubs.

Beginner
- 53
- 1
- 8
0
votes
1 answer
Problem with adding annotation for JAXB created classes
I'm using maven-jaxb2-plugin to generate my models based on .wsdl file. Now I need to add annotation to one of the classes. I tried to use jaxb2-basics-annotate and was very close to succeed, but now I'm stuck.
My goal is to achieve…

szczyzanski
- 81
- 3
0
votes
1 answer
jaxb2: Ignores annotation
This is my maven-jaxb2-plugin configuration:
org.jvnet.jaxb2.maven2
maven-jaxb2-plugin
0.14.0
…

Jordi Cabré
- 13
- 2