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/12/05 20:35:37 UTC

multiple xjc args in extraargs for Maven cxf-codegen-plugin configuration

After a bit of trial and error, I was able to apply multiple sets of xjc args
in respective extraargs.

This is handy when you need to specify multiple JAXB plugins and multiple
episodes for JAXB. Note that I still paired the related args with a
comma-delimiter in a single extraarg element (e.g.,
"-xjc-Xname,-Xname-classSubstitution=/$/Dto/")

I am including the entire Maven cxf-codegen-plugin XML with the extraargs
configuration here in case this is useful to anyone else.

-----------------------------------
<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.cassee.xjc-plugins</groupId>
            <artifactId>xjc-plugins-classname</artifactId>
            <version>0.3</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <verbose>true</verbose>
               
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                       
<wsdl>${basedir}/src/main/wsdl/TrainTrackService.wsdl</wsdl>
                        <extraargs>
                            <extraarg>-xjc-verbose</extraarg>
                           
<extraarg>-xjc-b,${basedir}/src/main/wsdl/core-response.episode</extraarg>
                           
<extraarg>-xjc-Xname,-Xname-classSubstitution=/$/Dto/</extraarg>
                           
<extraarg>-xjc-episode,${project.build.outputDirectory}/train-track-service.episode</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>
-----------------------------------
-- 
View this message in context: http://old.nabble.com/multiple-xjc-args-in-extraargs-for-Maven-cxf-codegen-plugin-configuration-tp26658501p26658501.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: multiple xjc args in extraargs for Maven cxf-codegen-plugin configuration

Posted by Cristian Botiza <Cr...@endava.com>.
Thank you for posting this.

Easier to use than SUN's maven-jaxb-plugin (which wasn't very hard after all).

I've used the xsdtojava goal from cxf-common-xsd.

________________________________________
From: stug23 [pat.podenski@gmail.com]
Sent: 05 December 2009 21:35
To: users@cxf.apache.org
Subject: multiple xjc args in extraargs for Maven cxf-codegen-plugin configuration

After a bit of trial and error, I was able to apply multiple sets of xjc args
in respective extraargs.

This is handy when you need to specify multiple JAXB plugins and multiple
episodes for JAXB. Note that I still paired the related args with a
comma-delimiter in a single extraarg element (e.g.,
"-xjc-Xname,-Xname-classSubstitution=/$/Dto/")

I am including the entire Maven cxf-codegen-plugin XML with the extraargs
configuration here in case this is useful to anyone else.

-----------------------------------
<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.cassee.xjc-plugins</groupId>
            <artifactId>xjc-plugins-classname</artifactId>
            <version>0.3</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <verbose>true</verbose>

<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>

<wsdl>${basedir}/src/main/wsdl/TrainTrackService.wsdl</wsdl>
                        <extraargs>
                            <extraarg>-xjc-verbose</extraarg>

<extraarg>-xjc-b,${basedir}/src/main/wsdl/core-response.episode</extraarg>

<extraarg>-xjc-Xname,-Xname-classSubstitution=/$/Dto/</extraarg>

<extraarg>-xjc-episode,${project.build.outputDirectory}/train-track-service.episode</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>
-----------------------------------
--
View this message in context: http://old.nabble.com/multiple-xjc-args-in-extraargs-for-Maven-cxf-codegen-plugin-configuration-tp26658501p26658501.html
Sent from the cxf-user mailing list archive at Nabble.com.

The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Any opinions expressed are mine and do not necessarily represent the opinions of the Company. Emails are susceptible to interference. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is strictly prohibited and may be unlawful. If you have received this message in error, do not open any attachments but please notify the EndavaIT Service Desk on (+44 (0)870 423 0187), and delete this message from your system. The sender accepts no responsibility for information, errors or omissions in this email, or for its use or misuse, or for any act committed or omitted in connection with this communication. If in doubt, please verify the authenticity of the contents with the sender. Please rely on your own virus checkers as no responsibility is taken by the sender for any damage rising out of any bug or virus infection.

Endava Limited is a company registered in England under company number 5722669 whose registered office is at 125 Old Broad Street, London, EC2N 1AR, United Kingdom. Endava Limited is the Endava group holding company and does not provide any services to clients. Each of Endava Limited and its subsidiaries is a separate legal entity and has no liability for another such entity's acts or omissions. Please refer to the “Legal” section on our website for a list of legal entities.

Re: multiple xjc args in extraargs for Maven cxf-codegen-plugin configuration

Posted by stug23 <pa...@gmail.com>.
Thanks for tip!

I like this approach much better. It is a clean way to express the args for
xjc.


dkulp wrote:
> 
> 
> Just a note:  with CXF 2.2.5, see:
> https://issues.apache.org/jira/browse/CXF-2445
> 
> Thus, you can use:
> <xjcargs>
>      <xjcarg>-verbose</xjcarg>
>      <xjcarg>-b,${basedir}/src/main/wsdl/core-response.episode</xjcarg>
>      <xjcarg>-Xname,-Xname-classSubstitution=/$/Dto/</xjcarg>
>      <xjcarg>-episode,${project.build.outputDirectory}/train-track-
> service.episode</xjcarg>
> </xjcargs>
> 
> which is then separate from the other stuff in extraargs.    It's up to
> you.  
> :-)
> 
> Dan
> 
> 
> 
> On Sat December 5 2009 2:35:37 pm stug23 wrote:
>> After a bit of trial and error, I was able to apply multiple sets of xjc
>>  args in respective extraargs.
>> 
>> This is handy when you need to specify multiple JAXB plugins and multiple
>> episodes for JAXB. Note that I still paired the related args with a
>> comma-delimiter in a single extraarg element (e.g.,
>> "-xjc-Xname,-Xname-classSubstitution=/$/Dto/")
>> 
>> I am including the entire Maven cxf-codegen-plugin XML with the extraargs
>> configuration here in case this is useful to anyone else.
>> 
>> -----------------------------------
>> <plugin>
>>     <groupId>org.apache.cxf</groupId>
>>     <artifactId>cxf-codegen-plugin</artifactId>
>>     <version>${cxf.version}</version>
>>     <dependencies>
>>         <dependency>
>>             <groupId>org.cassee.xjc-plugins</groupId>
>>             <artifactId>xjc-plugins-classname</artifactId>
>>             <version>0.3</version>
>>         </dependency>
>>     </dependencies>
>>     <executions>
>>         <execution>
>>             <id>generate-sources</id>
>>             <phase>generate-sources</phase>
>>             <configuration>
>>                 <verbose>true</verbose>
>> 
>> <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
>>                 <wsdlOptions>
>>                     <wsdlOption>
>> 
>> <wsdl>${basedir}/src/main/wsdl/TrainTrackService.wsdl</wsdl>
>>                         <extraargs>
>>                             <extraarg>-xjc-verbose</extraarg>
>> 
>> <extraarg>-xjc-b,${basedir}/src/main/wsdl/core-response.episode</extraarg>
>> 
>> <extraarg>-xjc-Xname,-Xname-classSubstitution=/$/Dto/</extraarg>
>> 
>> <extraarg>-xjc-episode,${project.build.outputDirectory}/train-track-service
>> .episode</extraarg> </extraargs>
>>                     </wsdlOption>
>>                 </wsdlOptions>
>>             </configuration>
>>             <goals>
>>                 <goal>wsdl2java</goal>
>>             </goals>
>>         </execution>
>>     </executions>
>> </plugin>
>> -----------------------------------
>> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/multiple-xjc-args-in-extraargs-for-Maven-cxf-codegen-plugin-configuration-tp26658501p26704639.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: multiple xjc args in extraargs for Maven cxf-codegen-plugin configuration

Posted by Daniel Kulp <dk...@apache.org>.
Just a note:  with CXF 2.2.5, see:
https://issues.apache.org/jira/browse/CXF-2445

Thus, you can use:
<xjcargs>
     <xjcarg>-verbose</xjcarg>
     <xjcarg>-b,${basedir}/src/main/wsdl/core-response.episode</xjcarg>
     <xjcarg>-Xname,-Xname-classSubstitution=/$/Dto/</xjcarg>
     <xjcarg>-episode,${project.build.outputDirectory}/train-track-
service.episode</xjcarg>
</xjcargs>

which is then separate from the other stuff in extraargs.    It's up to you.  
:-)

Dan



On Sat December 5 2009 2:35:37 pm stug23 wrote:
> After a bit of trial and error, I was able to apply multiple sets of xjc
>  args in respective extraargs.
> 
> This is handy when you need to specify multiple JAXB plugins and multiple
> episodes for JAXB. Note that I still paired the related args with a
> comma-delimiter in a single extraarg element (e.g.,
> "-xjc-Xname,-Xname-classSubstitution=/$/Dto/")
> 
> I am including the entire Maven cxf-codegen-plugin XML with the extraargs
> configuration here in case this is useful to anyone else.
> 
> -----------------------------------
> <plugin>
>     <groupId>org.apache.cxf</groupId>
>     <artifactId>cxf-codegen-plugin</artifactId>
>     <version>${cxf.version}</version>
>     <dependencies>
>         <dependency>
>             <groupId>org.cassee.xjc-plugins</groupId>
>             <artifactId>xjc-plugins-classname</artifactId>
>             <version>0.3</version>
>         </dependency>
>     </dependencies>
>     <executions>
>         <execution>
>             <id>generate-sources</id>
>             <phase>generate-sources</phase>
>             <configuration>
>                 <verbose>true</verbose>
> 
> <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
>                 <wsdlOptions>
>                     <wsdlOption>
> 
> <wsdl>${basedir}/src/main/wsdl/TrainTrackService.wsdl</wsdl>
>                         <extraargs>
>                             <extraarg>-xjc-verbose</extraarg>
> 
> <extraarg>-xjc-b,${basedir}/src/main/wsdl/core-response.episode</extraarg>
> 
> <extraarg>-xjc-Xname,-Xname-classSubstitution=/$/Dto/</extraarg>
> 
> <extraarg>-xjc-episode,${project.build.outputDirectory}/train-track-service
> .episode</extraarg> </extraargs>
>                     </wsdlOption>
>                 </wsdlOptions>
>             </configuration>
>             <goals>
>                 <goal>wsdl2java</goal>
>             </goals>
>         </execution>
>     </executions>
> </plugin>
> -----------------------------------
> 

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