You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Glen Mazza <gl...@verizon.net> on 2007/12/01 22:07:17 UTC

Re: Maven command to run wsdl2java...

Am Freitag, den 30.11.2007, 11:17 +0800 schrieb James Mao:
> Glen,
> 
> You have to do couple things in order to run codegen:wsdl2java under the 
> folder which contains the pom.xml
> You can take a look at the /tools/jdee which is a maven plugin i did for 
> generating the emacs jdee project
> 
> How it works?
> 
> 0. Look at the /tools/jdee/pom.xml, the group id is 
> org.apache.cxf.maven, the artifact id is maven-jdee-plugin
> 1. mvn install  (install the plugin)
> 2. Update the ~/.m2/settings.xml, add
> 
> <pluginGroups>
>    <pluginGroup>org.apache.cxf.maven</pluginGroup>
> </pluginGroups>
> 
> 
<snip/>

Oh I see...I looked this up, pluginGroups are described here:
http://maven.apache.org/settings.html#Simple_Values

Thanks for explaining this process for me.


> 
> The wsdl2java Mojo is a little bit different, the groupid is org.apache.cxf, you you have to add it into the ~/.m2/settings.xml
> <pluginGroups>
>    <pluginGroup>org.apache.cxf</pluginGroup>
> </pluginGroups>
> 

For some reason Maven seems to be able to detect the groupId for the
cxf-codegen-plugin even if I don't do this.  Adding this entry in
settings.xml or omitting it made no difference.


> And you have to change the artifact id of the codegen plugin from the cxf-codegen-plugin to maven-codegen-plugin

Actually, I just found out, you don't have to rename the plugin artifact
id if you state the first word:

mvn cxf-codegen:wsdl2java will work.

(It is just that if you omit the first word, it assumes it is "maven",
and hence things wouldn't work in our case here.)

> 
> And now, you can run 
> 
> mvn codegen:wsdl2java under the /testutils but that's not working, because wsdl2java will ask for the wsdlOption arguments etc.
> 

Yes, I got that error and just made a JIRA entry for it.  "mvn
generate-sources" runs wsdl2java fine but not the "mvn
cxf-codegen:wsdl2java" because of this error.


> The best solution i have is to modify the wsdl2java plugin using the CoC approach, in this way you don't have to put all the wsdls in your pom


> The solution is very similar to the function I added to fAnt[1]
> 
[1]http://maomaode.bokeland.com/blog/3/9741/2007/11/15/301276


Hmmm...for CoC perhaps you would want to place the wsdls in src/wsdl
instead of src/main/resources/wsdl -- IIRC the latter is normally for
files that get copied to the classpath, and FWIW src/wsdl is Sun's
default[2]

Thanks,
Glen

[2]
https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/wsimport-mojo.html#wsdlDirectory

> Hope this helps :)
> 
> Regards,
> James
> 
> 

> 
> 
> > Hello,
> >
> > I have another CXF/Maven[1] newbie question--to run wsdl2java using
> > Maven, what is the plugin prefix for wsdl2java, i.e.,
> > "mvn ????:wsdl2java" at the command line?  Currently I'm using "mvn
> > generate-sources" instead which works fine, but would like to see if I
> > can get it to work using the actual goal name.
> >
> > Thanks,
> > Glen
> >
> > [1] http://cwiki.apache.org/confluence/display/CXF20DOC/Maven
> > +Integration+and+Plugin
> >
> >
> >   


Re: Maven command to run wsdl2java...

Posted by James Mao <ja...@iona.com>.
> Am Freitag, den 30.11.2007, 11:17 +0800 schrieb James Mao:
>   
>> Glen,
>>
>> You have to do couple things in order to run codegen:wsdl2java under the 
>> folder which contains the pom.xml
>> You can take a look at the /tools/jdee which is a maven plugin i did for 
>> generating the emacs jdee project
>>
>> How it works?
>>
>> 0. Look at the /tools/jdee/pom.xml, the group id is 
>> org.apache.cxf.maven, the artifact id is maven-jdee-plugin
>> 1. mvn install  (install the plugin)
>> 2. Update the ~/.m2/settings.xml, add
>>
>> <pluginGroups>
>>    <pluginGroup>org.apache.cxf.maven</pluginGroup>
>> </pluginGroups>
>>
>>
>>     
> <snip/>
>
> Oh I see...I looked this up, pluginGroups are described here:
> http://maven.apache.org/settings.html#Simple_Values
>
> Thanks for explaining this process for me.
>
>
>   
>> The wsdl2java Mojo is a little bit different, the groupid is org.apache.cxf, you you have to add it into the ~/.m2/settings.xml
>> <pluginGroups>
>>    <pluginGroup>org.apache.cxf</pluginGroup>
>> </pluginGroups>
>>
>>     
>
> For some reason Maven seems to be able to detect the groupId for the
> cxf-codegen-plugin even if I don't do this.  Adding this entry in
> settings.xml or omitting it made no difference.
>
>
>   
>> And you have to change the artifact id of the codegen plugin from the cxf-codegen-plugin to maven-codegen-plugin
>>     
>
> Actually, I just found out, you don't have to rename the plugin artifact
> id if you state the first word:
>
> mvn cxf-codegen:wsdl2java will work.
>
> (It is just that if you omit the first word, it assumes it is "maven",
> and hence things wouldn't work in our case here.)
>   

Right, If you don't change the cxf-codegen-plugin to 
maven-codegen-plugin, then you have to use
mvn cxf-codegen:wsdl2java,

If you changed the artifact id to maven-codegen-plugin, then , you are 
allowed to do this
mvn codegen:wsdl2java, and in this case, you have to put the groupid 
into the ~/.m2/settings.xml
That's how it works

mvn codegen:wsdl2java looks neat, but mvn cxf-codegen:wsdl2java is 
easier, I always like to pick up the easier approach :)

Thanks for the information here.

>   
>> And now, you can run 
>>
>> mvn codegen:wsdl2java under the /testutils but that's not working, because wsdl2java will ask for the wsdlOption arguments etc.
>>
>>     
>
> Yes, I got that error and just made a JIRA entry for it.  "mvn
> generate-sources" runs wsdl2java fine but not the "mvn
> cxf-codegen:wsdl2java" because of this error.
>
>
>   
>> The best solution i have is to modify the wsdl2java plugin using the CoC approach, in this way you don't have to put all the wsdls in your pom
>>     
>
>
>   
>> The solution is very similar to the function I added to fAnt[1]
>>
>>     
> [1]http://maomaode.bokeland.com/blog/3/9741/2007/11/15/301276
>
>
> Hmmm...for CoC perhaps you would want to place the wsdls in src/wsdl
> instead of src/main/resources/wsdl -- IIRC the latter is normally for
> files that get copied to the classpath, and FWIW src/wsdl is Sun's
> default[2]
>   

Some wsdls are required to copy to the classpath, I guess it's required 
by the tests.

The directory I recommend is actually two

/src/main/resources/wsdl
/src/test/resources/wsdl

But I can add this dir as well, if the plugin detect there's wsdl under the
/src/wsdl

But I personally would like keep the /src as clean as just keeping only 
'main' and 'test' two folders
I'm not sure Maven has such rules for placing the files?

Regards,
James

> Thanks,
> Glen
>
> [2]
> https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/wsimport-mojo.html#wsdlDirectory
>
>   
>> Hope this helps :)
>>
>> Regards,
>> James
>>
>>
>>     
>
>   
>>     
>>> Hello,
>>>
>>> I have another CXF/Maven[1] newbie question--to run wsdl2java using
>>> Maven, what is the plugin prefix for wsdl2java, i.e.,
>>> "mvn ????:wsdl2java" at the command line?  Currently I'm using "mvn
>>> generate-sources" instead which works fine, but would like to see if I
>>> can get it to work using the actual goal name.
>>>
>>> Thanks,
>>> Glen
>>>
>>> [1] http://cwiki.apache.org/confluence/display/CXF20DOC/Maven
>>> +Integration+and+Plugin
>>>
>>>
>>>   
>>>       
>
>
>