cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF > cxf-xjc-plugin
Date Fri, 22 Oct 2010 18:26:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF/cxf-xjc-plugin">cxf-xjc-plugin</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >|dependencies| List of files that
are examined to determine if subsequent runs of the plugin must re-generate code. | <br>|deleteDirs|
List of directories that are removed after generation.   If you have schemas that generate
code that has already been generated, (possibly in a different maven module)  you can specify
this to have them removed.   The preferred method to do this, however, is a binding file with
the &quot;skip&quot; flag set on those namespaces.| <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br> <br>h3. Example: <br>{code:xml} <br> <br>            &lt;plugin&gt;
<br>                &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt; <br>
               &lt;artifactId&gt;cxf-xjc-plugin&lt;/artifactId&gt; <br>
               &lt;version&gt;2.3.0&lt;/version&gt; <br>           
    &lt;configuration&gt; <br>                    &lt;extensions&gt;
<br>                        &lt;extension&gt;org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0&lt;/extension&gt;
<br>                    &lt;/extensions&gt; <br>                &lt;/configuration&gt;
<br>                &lt;executions&gt; <br>                    &lt;execution&gt;
<br>                        &lt;id&gt;generate-sources&lt;/id&gt; <br>
                       &lt;phase&gt;generate-sources&lt;/phase&gt; <br>
                       &lt;goals&gt; <br>                            &lt;goal&gt;xsdtojava&lt;/goal&gt;
<br>                        &lt;/goals&gt; <br>                      
 &lt;configuration&gt; <br>                            &lt;sourceRoot&gt;${basedir}/target/generated/src/main/java&lt;/sourceRoot&gt;
<br>                            &lt;xsdOptions&gt; <br>              
                 &lt;xsdOption&gt; <br>                                    &lt;xsd&gt;classpath:/schemas/wsdl/http.xsd&lt;/xsd&gt;
<br>                                    &lt;bindingFile&gt;classpath:/schemas/wsdl/http.xjb&lt;/bindingFile&gt;
<br>                                    &lt;catalog&gt;${basedir}/src/main/build-resources/catalog.cat&lt;/catalog&gt;
<br>                                &lt;/xsdOption&gt; <br>          
                     &lt;xsdOption&gt; <br>                                
   &lt;xsd&gt;classpath:/schemas/wsdl/ws-addr.xsd&lt;/xsd&gt; <br> 
                                  &lt;packagename&gt;org.apache.cxf.ws.addressing&lt;/packagename&gt;
<br>                                &lt;/xsdOption&gt; <br>          
                     &lt;xsdOption&gt; <br>                                
   &lt;xsd&gt;classpath:/schemas/wsdl/addressing.xsd&lt;/xsd&gt; <br>
                                   &lt;bindingFile&gt;classpath:/schemas/wsdl/addressing.xjb&lt;/bindingFile&gt;
<br>                                &lt;/xsdOption&gt; <br>          
                     &lt;xsdOption&gt; <br>                                
   &lt;xsd&gt;classpath:/schemas/configuration/security.xsd&lt;/xsd&gt; <br>
                                   &lt;bindingFile&gt;classpath:/schemas/configuration/security.xjb&lt;/bindingFile&gt;
<br>                                    &lt;catalog&gt;${basedir}/src/main/build-resources/catalog.cat&lt;/catalog&gt;
<br>                                    &lt;extensionArgs&gt; <br>   
                                    &lt;extensionArg&gt;-Xdv&lt;/extensionArg&gt;
<br>                                    &lt;/extensionArgs&gt; <br>  
                             &lt;/xsdOption&gt; <br>                       
        &lt;xsdOption&gt; <br>                                    &lt;xsd&gt;classpath:/schemas/wsdl/ws-addr-wsdl.xsd&lt;/xsd&gt;
<br>                                    &lt;bindingFile&gt;classpath:/schemas/wsdl/ws-addr-wsdl.xjb&lt;/bindingFile&gt;
<br>                                    &lt;extension&gt;true&lt;/extension&gt;
<br>                                &lt;/xsdOption&gt; <br>          
                     &lt;xsdOption&gt; <br>                                
   &lt;xsd&gt;classpath:/schemas/wsdl/addressing200403.xsd&lt;/xsd&gt; <br>
                                   &lt;bindingFile&gt;classpath:/schemas/wsdl/addressing200403.xjb&lt;/bindingFile&gt;
<br>                                &lt;/xsdOption&gt; <br>          
                 &lt;/xsdOptions&gt; <br>                        &lt;/configuration&gt;
<br>                    &lt;/execution&gt; <br>                &lt;/executions&gt;
<br>            &lt;/plugin&gt; <br> <br>{code} <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="cxf-xjc-plugin-TheCXFXJCMavenPlugin"></a>The CXF  XJC
Maven Plugin</h2>

<p>The CXF  XJC Maven Plugin is a wrapper around the JAXB XJC tool to handle the XSD
-&gt; Java tasks.</p>

<p>There are two targets:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> xsdtojava </td>
<td class='confluenceTd'> Defaults into generate-sources phase and outputs to ${project.build.directory}/generated/src/main/java
</td>
</tr>
<tr>
<td class='confluenceTd'> xsdtojava-tests </td>
<td class='confluenceTd'> Defaults into generate-test-sources phase and outputs to ${project.build.directory}/generated/src/test/java
</td>
</tr>
</tbody></table>
</div>



<p>Parameters</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> extensions </td>
<td class='confluenceTd'> List of maven artifacts to add to the extension classpath.
 Each item in the list is a string of groupId:artifactId:version.</td>
</tr>
<tr>
<td class='confluenceTd'> xsdOptions </td>
<td class='confluenceTd'> List of XsdOption objects.  See below. </td>
</tr>
<tr>
<td class='confluenceTd'>sourceRoot/testSourceRoot </td>
<td class='confluenceTd'> For the two targets above, override the default output directory.
</td>
</tr>
</tbody></table>
</div>



<p>The XsdOption object is used to pass specific options and configuration for each
XSD file that is to be processed. </p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'>xsd</td>
<td class='confluenceTd'> The location of the schema to process. </td>
</tr>
<tr>
<td class='confluenceTd'>bindingFile</td>
<td class='confluenceTd'> The location of the JAXB binding file to customize the output.
</td>
</tr>
<tr>
<td class='confluenceTd'>packagename</td>
<td class='confluenceTd'>  Specifies the package name to use for the outputted code.
</td>
</tr>
<tr>
<td class='confluenceTd'>extension</td>
<td class='confluenceTd'> (boolean) Turns on the custom JAXB implementation extensions.
</td>
</tr>
<tr>
<td class='confluenceTd'>catalog</td>
<td class='confluenceTd'> The location of a catalog file for mapping schema locations.
</td>
</tr>
<tr>
<td class='confluenceTd'>extensionArgs</td>
<td class='confluenceTd'> List of additional  arguements passed to XJC.  (ex:  -Xlocator)
 </td>
</tr>
<tr>
<td class='confluenceTd'>dependencies</td>
<td class='confluenceTd'> List of files that are examined to determine if subsequent
runs of the plugin must re-generate code. </td>
</tr>
<tr>
<td class='confluenceTd'>deleteDirs</td>
<td class='confluenceTd'> List of directories that are removed after generation.   If
you have schemas that generate code that has already been generated, (possibly in a different
maven module)  you can specify this to have them removed.   The preferred method to do this,
however, is a binding file with the "skip" flag set on those namespaces.</td>
</tr>
</tbody></table>
</div>



<h3><a name="cxf-xjc-plugin-Example%3A"></a>Example:</h3>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">

            <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.cxf<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>cxf-xjc-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;version&gt;</span>2.3.0<span
class="code-tag">&lt;/version&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;extensions&gt;</span>
                        <span class="code-tag">&lt;extension&gt;</span>org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0<span
class="code-tag">&lt;/extension&gt;</span>
                    <span class="code-tag">&lt;/extensions&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
                <span class="code-tag">&lt;executions&gt;</span>
                    <span class="code-tag">&lt;execution&gt;</span>
                        <span class="code-tag">&lt;id&gt;</span>generate-sources<span
class="code-tag">&lt;/id&gt;</span>
                        <span class="code-tag">&lt;phase&gt;</span>generate-sources<span
class="code-tag">&lt;/phase&gt;</span>
                        <span class="code-tag">&lt;goals&gt;</span>
                            <span class="code-tag">&lt;goal&gt;</span>xsdtojava<span
class="code-tag">&lt;/goal&gt;</span>
                        <span class="code-tag">&lt;/goals&gt;</span>
                        <span class="code-tag">&lt;configuration&gt;</span>
                            <span class="code-tag">&lt;sourceRoot&gt;</span>${basedir}/target/generated/src/main/java<span
class="code-tag">&lt;/sourceRoot&gt;</span>
                            <span class="code-tag">&lt;xsdOptions&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/wsdl/http.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;bindingFile&gt;</span>classpath:/schemas/wsdl/http.xjb<span
class="code-tag">&lt;/bindingFile&gt;</span>
                                    <span class="code-tag">&lt;catalog&gt;</span>${basedir}/src/main/build-resources/catalog.cat<span
class="code-tag">&lt;/catalog&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/wsdl/ws-addr.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;packagename&gt;</span>org.apache.cxf.ws.addressing<span
class="code-tag">&lt;/packagename&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/wsdl/addressing.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;bindingFile&gt;</span>classpath:/schemas/wsdl/addressing.xjb<span
class="code-tag">&lt;/bindingFile&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/configuration/security.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;bindingFile&gt;</span>classpath:/schemas/configuration/security.xjb<span
class="code-tag">&lt;/bindingFile&gt;</span>
                                    <span class="code-tag">&lt;catalog&gt;</span>${basedir}/src/main/build-resources/catalog.cat<span
class="code-tag">&lt;/catalog&gt;</span>
                                    <span class="code-tag">&lt;extensionArgs&gt;</span>
                                        <span class="code-tag">&lt;extensionArg&gt;</span>-Xdv<span
class="code-tag">&lt;/extensionArg&gt;</span>
                                    <span class="code-tag">&lt;/extensionArgs&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/wsdl/ws-addr-wsdl.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;bindingFile&gt;</span>classpath:/schemas/wsdl/ws-addr-wsdl.xjb<span
class="code-tag">&lt;/bindingFile&gt;</span>
                                    <span class="code-tag">&lt;extension&gt;</span>true<span
class="code-tag">&lt;/extension&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                                <span class="code-tag">&lt;xsdOption&gt;</span>
                                    <span class="code-tag">&lt;xsd&gt;</span>classpath:/schemas/wsdl/addressing200403.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                                    <span class="code-tag">&lt;bindingFile&gt;</span>classpath:/schemas/wsdl/addressing200403.xjb<span
class="code-tag">&lt;/bindingFile&gt;</span>
                                <span class="code-tag">&lt;/xsdOption&gt;</span>
                            <span class="code-tag">&lt;/xsdOptions&gt;</span>
                        <span class="code-tag">&lt;/configuration&gt;</span>
                    <span class="code-tag">&lt;/execution&gt;</span>
                <span class="code-tag">&lt;/executions&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>

</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CXF/cxf-xjc-plugin">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=24184060&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CXF/cxf-xjc-plugin?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message