Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 262029F84 for ; Thu, 14 Jun 2012 14:48:20 +0000 (UTC) Received: (qmail 70829 invoked by uid 500); 14 Jun 2012 14:48:20 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 70774 invoked by uid 500); 14 Jun 2012 14:48:20 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 70767 invoked by uid 99); 14 Jun 2012 14:48:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 14:48:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 14:48:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 41987238890B for ; Thu, 14 Jun 2012 14:47:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821731 - in /websites/production/cxf/content: cache/docs.pageCache docs/maven-cxf-codegen-plugin-wsdl-to-java.html Date: Thu, 14 Jun 2012 14:47:55 -0000 To: commits@cxf.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120614144755.41987238890B@eris.apache.org> Author: buildbot Date: Thu Jun 14 14:47:54 2012 New Revision: 821731 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html Modified: websites/production/cxf/content/cache/docs.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html ============================================================================== --- websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html (original) +++ websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html Thu Jun 14 14:47:54 2012 @@ -150,12 +150,14 @@ Apache CXF -- Maven cxf-codegen-plugin (

In this example we're running the wsdl2java goal in the generate-sources phase. By running mvn generate-sources, CXF will generate artifacts in the <sourceRoot> directory that you specify. Each <wsdlOption> element corresponds to a WSDL that you're generated artifacts for. In the above example we're generating we're specifying the WSDL location via the <wsdl> option.

-

Other configuration arguments can be included inside the <wsdlOption> element. These pass arguments to the tooling and correspond to the options outlined on the WSDL to Java page, for example:

+

The following example shows some customization options. By default, the codegen plugin follows the Maven convention of "target/generated-sources/cxf" for the output folder for the generated classes. You can override this value using <sourceRoot> as shown below, but note this is usually not necessary, the default is fine for most people and can make it easier for some IDE's to detect the generated source code. Other configuration arguments can be included inside the <wsdlOption> element. These pass arguments to the tooling and correspond to the options outlined on the WSDL to Java page.

 ...
-<wsdlOptions>
+<configuration>
+    <sourceRoot>${project.build.directory}/generated-code/mywebservice</sourceRoot>
+    <wsdlOptions>
 	<wsdlOption>
 		<wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
                 <extraargs>
@@ -163,15 +165,12 @@ Apache CXF -- Maven cxf-codegen-plugin (
                     <extraarg>-verbose</extraarg>
                 </extraargs>
 	</wsdlOption>
-</wsdlOptions>
+    </wsdlOptions>
+</configuration>
 ...
 
- -

For CXF 2.1.4 and latter you don't need anymore to specify the <phase>, as generate-sources is the default.
-For CXF 2.2 and latter you don't even need to specify the <sourceRoot> to match maven convention for using target/generated-sources/cxf as output folder for generated classes.

-

See this blog entry for a full service and client example that uses the cxf-codegen-plugin.

Example 1: Passing in a JAX-WS Binding file

@@ -179,7 +178,6 @@ For CXF 2.2 and latter you don't even ne
 <configuration>
-  <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>
   <wsdlOptions>
     <wsdlOption>
       <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
@@ -191,6 +189,7 @@ For CXF 2.2 and latter you don't even ne
 </configuration>
 
+

In this example we're specifying that we want CXF to use our JAX-WS binding file. Binding files are a way to customize the output of the artifacts that CXF generates. For instance, it allows you to change the package name CXF uses.

Example 2: Specifying a service to generate artifacts for

@@ -198,7 +197,6 @@ For CXF 2.2 and latter you don't even ne
 <configuration>
-  <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
   <wsdlOptions>
     <wsdlOption>
       <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
@@ -217,7 +215,6 @@ For CXF 2.2 and latter you don't even ne
 
 <configuration>
-  <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>
   <defaultOptions>
       <bindingFiles>
           <bindingFile>${basedir}/src/main/jaxb/bindings.xml</bindingFile>
@@ -247,7 +244,6 @@ For CXF 2.2 and latter you don't even ne
 
 <configuration>
-  <sourceRoot>${basedir}/target/generated/cxf</sourceRoot>
   <defaultOptions>
       <bindingFiles>
           <bindingFile>${basedir}/src/main/jaxb/bindings.xml</bindingFile>
@@ -308,7 +304,6 @@ For CXF 2.2 and latter you don't even ne
     <id>generate-sources</id>
     <phase>generate-sources</phase>
     <configuration>
-      <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
       <wsdlOptions>
         <wsdlOption>
           <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>