Re: Maven command to run wsdl2java...

2007-12-02 Thread James Mao



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
   pluginGrouporg.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
   pluginGrouporg.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


  
  



  




Re: Maven command to run wsdl2java...

2007-12-01 Thread Glen Mazza
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
pluginGrouporg.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
pluginGrouporg.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...

2007-11-30 Thread Daniel Kulp

Glen,

Maven plugins can always be invoked via their full name:

groupid:artifactid:version:goal

(I might have the version/goal switched)

Thus, you should be able to do:

mvn org.apache.cxf:cxf-codegen-plugin:wsdl2java

Dan



On Thursday 29 November 2007, Glen Mazza wrote:
 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



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: Maven command to run wsdl2java...

2007-11-29 Thread 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
  pluginGrouporg.apache.cxf.maven/pluginGroup
/pluginGroups


3.  cd /trunk

4. mvn jdee:jdee

The first jdee is the middle word in the artifact id, the second jdee is the 
Mojo tools/jdee/src/main/java/org/apache/cxf/maven_plugin/jdee/JdeeMojo.java
See the annotation in the class, the goal is jdee

And, as you see, we have a 
tools/jdee/src/main/java/org/apache/cxf/maven_plugin/jdee/CleanMojo.java


Thus you're allow to clean the emacs jdee project with the command

mvn jdee:clean


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
  pluginGrouporg.apache.cxf/pluginGroup
/pluginGroups

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

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.

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]

Hope this helps :)

Regards,
James


[1]http://maomaode.bokeland.com/blog/3/9741/2007/11/15/301276



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