From 977b6f0e9a70652c8c5ae5b487e380e56ca213a6 Mon Sep 17 00:00:00 2001 From: "gu.martinm@gmail.com" Date: Mon, 18 May 2015 22:43:22 +0200 Subject: [PATCH] With cxf-xjc-plugin and cxf-codegen-plugin we can use many other plugins. I was using jaxb2-basics for inheritance but now I also use jaxb2-basics-annotate which allow me to annotate classes, methods properties, etc, etc. These plugins generate code from xsd files. We can also use custom bindings if we do not want (or we may not) modify the xsd files but we want to generate code with those extensions (inheritance and annotation) --- pom.xml | 50 ++++++++++++++++++++++++-------- src/main/resources/xsd/custombinding.xjb | 8 ++++- src/main/resources/xsd/examples.xsd | 4 ++- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 450e486..79484f5 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.jvnet.jaxb2_commons jaxb2-basics-runtime - 0.6.3 + 0.9.4 @@ -180,13 +180,13 @@ org.apache.cxf cxf-xjc-plugin - 2.3.0 + 3.0.3 org.apache.cxf cxf-codegen-plugin - 2.3.0 + 3.1.0 org.codehaus.mojo @@ -289,20 +289,41 @@ ${project.xsd.schemas.package.name} -Xinheritance + -Xannotate - - + + org.jvnet.jaxb2_commons jaxb2-basics - 0.6.3 + 0.9.4 + + + + + org.jvnet.jaxb2_commons + jaxb2-basics-annotate + 1.0.1 @@ -336,14 +357,19 @@ - + org.jvnet.jaxb2_commons jaxb2-basics - 0.6.3 + 0.9.4 diff --git a/src/main/resources/xsd/custombinding.xjb b/src/main/resources/xsd/custombinding.xjb index 9ceb3a9..08d81e9 100644 --- a/src/main/resources/xsd/custombinding.xjb +++ b/src/main/resources/xsd/custombinding.xjb @@ -3,8 +3,9 @@ + jaxb:extensionBindingPrefixes="inheritance annox"> + diff --git a/src/main/resources/xsd/examples.xsd b/src/main/resources/xsd/examples.xsd index d951278..f8f068b 100644 --- a/src/main/resources/xsd/examples.xsd +++ b/src/main/resources/xsd/examples.xsd @@ -4,8 +4,9 @@ @@ -14,6 +15,7 @@ + @java.lang.SuppressWarnings({"unchecked","rawtypes"}) de.spring.webservices.operations.Request -- 2.1.4