You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by stug23 <pa...@gmail.com> on 2009/06/14 19:01:57 UTC

How can I pass arguments to JAXB and use JAXB plugins with CXF Maven plugin?

In examining the documentation for CXF, I couldn't find information on how to
use the Maven plugin (WSDL first) that can pass arguments to JAXB. In
particular I need to configure/use JAXB plugins that get invoked when the
WSDL to Java code generator invokes JAXB's code generator.

Examples of such plugins for JAXB can be found at
<https://jaxb2-commons.dev.java.net/>

Another need for passing arguments to JAXB is for the use of JAXB episode
files -- I did note that JAXB binding files are supported by the CXF Maven
plugin. A JAXB episode file can be used to prevent regeneration of Java code
for an imported XML Schema for which custom Java code exists (and which is
on the classpath).

For more on separate compilation with JAXB episodes please see
<http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html>

TIA!

-- 
View this message in context: http://www.nabble.com/How-can-I-pass-arguments-to-JAXB-and-use-JAXB-plugins-with-CXF-Maven-plugin--tp24023624p24023624.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How can I pass arguments to JAXB and use JAXB plugins with CXF Maven plugin?

Posted by Daniel Kulp <dk...@apache.org>.
Using the <extraArgs> element of the plugin configuration, you should be able 
to pass something like:

-xjc-Xts 

or similar (-Xts is our "toString" plugin to xjc).   From the help output:


Specifies a comma separated list of arguments that are
passed directly to XJC when the JAXB data binding is used.
This option causes XJC to load additional plugins that
augment code generation. For example to load the
toString(ts) plugin that will add a toString() method to
all generated types the following <xjc arguments> would be
used: -xjc-Xts A list of available XJC plugins can be
obtained by using -xjc-X.


To get your plugin on the classpath for xjc, you will need to add it as a 
plugin dependency.   

<plugin>
     <artifactId>cxf-codegen-plugin</...>
     ....
     <dependencies>
          <dependency>
              <artifactId>my-xjc-plugin-id</...
          ....


Dan




On Sun June 14 2009 1:01:57 pm stug23 wrote:
> In examining the documentation for CXF, I couldn't find information on how
> to use the Maven plugin (WSDL first) that can pass arguments to JAXB. In
> particular I need to configure/use JAXB plugins that get invoked when the
> WSDL to Java code generator invokes JAXB's code generator.
>
> Examples of such plugins for JAXB can be found at
> <https://jaxb2-commons.dev.java.net/>
>
> Another need for passing arguments to JAXB is for the use of JAXB episode
> files -- I did note that JAXB binding files are supported by the CXF Maven
> plugin. A JAXB episode file can be used to prevent regeneration of Java
> code for an imported XML Schema for which custom Java code exists (and
> which is on the classpath).
>
> For more on separate compilation with JAXB episodes please see
> <http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html>
>
> TIA!

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog