On Monday, March 19, 2012 02:25:09 PM David Karlsen wrote:
> It would be very handy if these could be resolved as classpath:
> resources like in spring.

You MIGHT be able to with CXF.  I haven't actually tried this, but I think 
this should work:

<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf-plugin.version}</version>
<dependencies>
   <dependency>
          <groupId>my.group.id</groupId>
          <artifactId>myArtifactId</artifactId>
          <version>1.0</version>
     </dependency>
</dependency>
<executions>
   <execution>
     <id>generate-soap-client</id>
     <configuration>
       <wsdlOptions>
         <wsdlOption>
           <wsdl>classpath:my.wsdl</wsdl>
....

Adding the dependency should throw the jar on the classpath for the plugin 
and the classpath: URL should allow CXF to load it from there.    

Like I said, I haven't tried it before, but might be worth a shot.  :-)


Dan





> 
> 2012/3/17 Marcel Stör <[email protected]>:
> > In the past I've been using the codegen Maven plugin like this:
> > 
> > <groupId>org.apache.cxf</groupId>
> > <artifactId>cxf-codegen-plugin</artifactId>
> > <version>${cxf-plugin.version}</version>
> > <executions>
> >  <execution>
> >    <id>generate-soap-client</id>
> >    <configuration>
> >      <wsdlOptions>
> >        <wsdlOption>
> >          <wsdl>${basedir}/src/main/wsdl/my.wsdl</wsdl>
> > 
> > Obviously this required the WDSL file to be present in the module.
> > 
> > Now I was looking into referencing the WSDL from a JAR dependency.
> > Example 5 in the manual[1] shows that this can be achieved given that
> > there's a Maven artifact with just the WSDL in it.
> > In my case, however, the WSDL is stored as a regular resource in a JAR
> > file that contains other artifacts. So, it's my.jar!/my.wsdl in Java
> > JAR notation.
> > 
> > Looking at WsdlArtifact.java[2] I saw no option which would allow me to
> > achieve what I want.
> > 
> > It tried
> > 
> > <wsdlOptions>
> >  <wsdlOption>
> >    <wsdl>${settings.localRepository}/path-to-my.jar!/my.wsdl</wsdl>
> >  </wsdlOption>
> > </wsdlOptions>
> > 
> > which failed. I've never written a Maven plugin but from looking at
> > AbstractCodegenMoho.java[3] I'm now convinced that it can't be done.
> > 
> > Is this correct?
> > 
> > Cheers,
> > Marcel
> > 
> > 
> > [1]
> > http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
> > [2]
> > http://svn.apache.org/repos/asf/cxf/trunk/maven-plugins/codegen-plugin/s
> > rc/main/java/org/apache/cxf/maven_plugin/WsdlArtifact.java [3]
> > http://svn.apache.org/repos/asf/cxf/trunk/maven-plugins/codegen-plugin/s
> > rc/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
> > 
> > --
> > Marcel Stör, http://www.frightanic.com
> > Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
> > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to