You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Joerg Hubschneider <jo...@ericsson.com> on 2008/05/16 11:55:37 UTC

maven cxf-codegen-plugin question

Hello all,

I have question belonging to the maven cxf-code-gen-plugin (version
2.0.6)

 

It is possible to generate java stubs on command line using a xjs plugin
(-Xts) to generate toString() methods for generated data structures
like: 

Cxf-2.0.6>> wsdl2java -xjs-Xts
src/main/resources/tmf854v20/DDPs/Framework/IIS/wsdl/Mart/MartJms.wsdl

 

In the following I want create java stubs using maven with following
pom.xml sequence:

..

                <groupId>org.apache.cxf</groupId>

                <artifactId>cxf-codegen-plugin</artifactId>

                <version>2.0.6</version>

                <executions>

                    <execution>

                        <id>generate-sources</id>

                        <phase>generate-sources</phase>

                        <configuration>

 
<sourceRoot>${basedir}/target/generated-sources/wsdl</sourceRoot>

                            <wsdlOptions>

                                <wsdlOption>

 
<wsdl>${basedir}/src/main/resources/tmf854v20/DDPs/Framework/IIS/wsdl/Ma
rt/MartJms.wsdl</wsdl>

                                    <extraargs>

                                        <extraarg>-all</extraarg>

                                        <extraarg>-xjc-Xts</extraarg>

                                    </extraargs>

                                </wsdlOption>

                                   .....

But, what I get was following BUILD ERROR:

 

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] XJC reported 'BadCommandLineException' for -xjc argument:-Xts

avaliable plugin options:

  -Xlocator          :  enable source location support for generated
code

  -Xsync-methods     :  generate accessor methods with the
'synchronized' keyword

  -mark-generated    :  mark the generated code as
@javax.annotation.Generated

 

 

unrecognized parameter -Xts

[INFO]
------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 4 seconds

[INFO] Finished at: Fri May 16 11:11:13 CEST 2008

[INFO] Final Memory: 17M/213M

[INFO]
------------------------------------------------------------------------

 

It seems that the cxf-codegen-plugin does not support the "-Xts" xjc
plugin.

The question is why? 

Is it a bug or wrong configuration?

 

Any help is appreciated!

 

Kind regards

 

Joerg Hubschneider

 


RE: maven cxf-codegen-plugin question

Posted by Joerg Hubschneider <jo...@ericsson.com>.
Hi Daniel,

Thx for your advice!
I have tested it, and it works properly!

For interesting people:
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>2.0.6</version>
                  <dependencies>
                     <dependency>
                       <groupId>org.apache.cxf</groupId>
                       <artifactId>cxf-codegen-plugin</artifactId>
                       <version>2.0.6</version>
                     </dependency>
                     <dependency>
                       <groupId>org.apache.cxf</groupId>
                       <artifactId>cxf-xjc-ts</artifactId>
                       <version>2.0.6</version>
                     </dependency>
                  </dependencies>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
 
<sourceRoot>${basedir}/target/generated-sources/wsdl</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
 
<wsdl>${basedir}/src/main/resources/tmf854v20/DDPs/Framework/IIS/wsdl/Ma
rt/MartJms.wsdl</wsdl>
                                    <extraargs>
                                        <extraarg>-all</extraarg>
                                        <extraarg>-xjc-Xts</extraarg>
                                    </extraargs>
                                </wsdlOption>
			
... does the java stub generation with toString() support!

Thanks a lot!
Joerg



-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Freitag, 16. Mai 2008 17:26
To: users@cxf.apache.org
Subject: Re: maven cxf-codegen-plugin question



You need to get the org.apache.cxf:cxf-xjc-ts module configured in as  
a dependency somehow.   You MIGHT be able to just depend on it for  
your project.   Alternatively, add it as a dependency to the plugin.    
Something like:

<plugin>
                <groupId>org.apache.cxf</groupId>
	       <artifactId>cxf-codegen-plugin</artifactId>
                <version>2.0.6</version>
                <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf</groupId>
	                    <artifactId>cxf-codegen-plugin</artifactId>
                             <version>2.0.6</version>
                         </dependency>
                 </dependencies>

That should allow it to work.   Any of the xjc plugins that are out  
there should work that way.

Dan



On May 16, 2008, at 5:55 AM, Joerg Hubschneider wrote:

> Hello all,
>
> I have question belonging to the maven cxf-code-gen-plugin (version
> 2.0.6)
>
>
>
> It is possible to generate java stubs on command line using a xjs  
> plugin
> (-Xts) to generate toString() methods for generated data structures
> like:
>
> Cxf-2.0.6>> wsdl2java -xjs-Xts
> src/main/resources/tmf854v20/DDPs/Framework/IIS/wsdl/Mart/MartJms.wsdl
>
>
>
> In the following I want create java stubs using maven with following
> pom.xml sequence:
>
> ..
>
>                <groupId>org.apache.cxf</groupId>
>
>                <artifactId>cxf-codegen-plugin</artifactId>
>
>                <version>2.0.6</version>
>
>                <executions>
>
>                    <execution>
>
>                        <id>generate-sources</id>
>
>                        <phase>generate-sources</phase>
>
>                        <configuration>
>
>
> <sourceRoot>${basedir}/target/generated-sources/wsdl</sourceRoot>
>
>                            <wsdlOptions>
>
>                                <wsdlOption>
>
>
> <wsdl>${basedir}/src/main/resources/tmf854v20/DDPs/Framework/IIS/ 
> wsdl/Ma
> rt/MartJms.wsdl</wsdl>
>
>                                    <extraargs>
>
>                                        <extraarg>-all</extraarg>
>
>                                        <extraarg>-xjc-Xts</extraarg>
>
>                                    </extraargs>
>
>                                </wsdlOption>
>
>                                   .....
>
> But, what I get was following BUILD ERROR:
>
>
>
> [INFO]
>
------------------------------------------------------------------------
>
> [ERROR] BUILD ERROR
>
> [INFO]
>
------------------------------------------------------------------------
>
> [INFO] XJC reported 'BadCommandLineException' for -xjc argument:-Xts
>
> avaliable plugin options:
>
>  -Xlocator          :  enable source location support for generated
> code
>
>  -Xsync-methods     :  generate accessor methods with the
> 'synchronized' keyword
>
>  -mark-generated    :  mark the generated code as
> @javax.annotation.Generated
>
>
>
>
>
> unrecognized parameter -Xts
>
> [INFO]
>
------------------------------------------------------------------------
>
> [INFO] For more information, run Maven with the -e switch
>
> [INFO]
>
------------------------------------------------------------------------
>
> [INFO] Total time: 4 seconds
>
> [INFO] Finished at: Fri May 16 11:11:13 CEST 2008
>
> [INFO] Final Memory: 17M/213M
>
> [INFO]
>
------------------------------------------------------------------------
>
>
>
> It seems that the cxf-codegen-plugin does not support the "-Xts" xjc
> plugin.
>
> The question is why?
>
> Is it a bug or wrong configuration?
>
>
>
> Any help is appreciated!
>
>
>
> Kind regards
>
>
>
> Joerg Hubschneider
>
>
>

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





Re: maven cxf-codegen-plugin question

Posted by Daniel Kulp <dk...@apache.org>.

You need to get the org.apache.cxf:cxf-xjc-ts module configured in as  
a dependency somehow.   You MIGHT be able to just depend on it for  
your project.   Alternatively, add it as a dependency to the plugin.    
Something like:

<plugin>
                <groupId>org.apache.cxf</groupId>
	       <artifactId>cxf-codegen-plugin</artifactId>
                <version>2.0.6</version>
                <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf</groupId>
	                    <artifactId>cxf-codegen-plugin</artifactId>
                             <version>2.0.6</version>
                         </dependency>
                 </dependencies>

That should allow it to work.   Any of the xjc plugins that are out  
there should work that way.

Dan



On May 16, 2008, at 5:55 AM, Joerg Hubschneider wrote:

> Hello all,
>
> I have question belonging to the maven cxf-code-gen-plugin (version
> 2.0.6)
>
>
>
> It is possible to generate java stubs on command line using a xjs  
> plugin
> (-Xts) to generate toString() methods for generated data structures
> like:
>
> Cxf-2.0.6>> wsdl2java -xjs-Xts
> src/main/resources/tmf854v20/DDPs/Framework/IIS/wsdl/Mart/MartJms.wsdl
>
>
>
> In the following I want create java stubs using maven with following
> pom.xml sequence:
>
> ..
>
>                <groupId>org.apache.cxf</groupId>
>
>                <artifactId>cxf-codegen-plugin</artifactId>
>
>                <version>2.0.6</version>
>
>                <executions>
>
>                    <execution>
>
>                        <id>generate-sources</id>
>
>                        <phase>generate-sources</phase>
>
>                        <configuration>
>
>
> <sourceRoot>${basedir}/target/generated-sources/wsdl</sourceRoot>
>
>                            <wsdlOptions>
>
>                                <wsdlOption>
>
>
> <wsdl>${basedir}/src/main/resources/tmf854v20/DDPs/Framework/IIS/ 
> wsdl/Ma
> rt/MartJms.wsdl</wsdl>
>
>                                    <extraargs>
>
>                                        <extraarg>-all</extraarg>
>
>                                        <extraarg>-xjc-Xts</extraarg>
>
>                                    </extraargs>
>
>                                </wsdlOption>
>
>                                   .....
>
> But, what I get was following BUILD ERROR:
>
>
>
> [INFO]
> ------------------------------------------------------------------------
>
> [ERROR] BUILD ERROR
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] XJC reported 'BadCommandLineException' for -xjc argument:-Xts
>
> avaliable plugin options:
>
>  -Xlocator          :  enable source location support for generated
> code
>
>  -Xsync-methods     :  generate accessor methods with the
> 'synchronized' keyword
>
>  -mark-generated    :  mark the generated code as
> @javax.annotation.Generated
>
>
>
>
>
> unrecognized parameter -Xts
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] For more information, run Maven with the -e switch
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Total time: 4 seconds
>
> [INFO] Finished at: Fri May 16 11:11:13 CEST 2008
>
> [INFO] Final Memory: 17M/213M
>
> [INFO]
> ------------------------------------------------------------------------
>
>
>
> It seems that the cxf-codegen-plugin does not support the "-Xts" xjc
> plugin.
>
> The question is why?
>
> Is it a bug or wrong configuration?
>
>
>
> Any help is appreciated!
>
>
>
> Kind regards
>
>
>
> Joerg Hubschneider
>
>
>

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