You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bobby Warner <bo...@gmail.com> on 2009/07/08 23:36:22 UTC
Header for Generated Code
Is there a way to easily add comments (like the apache license header (
http://www.apache.org/legal/src-headers.html for example) at the top of all
wsdl2java generated classes? I could write a script to do this, but it
would be better if there was a way to do this as part of the Maven plugin.
I looked through the documentation and didn't see anything specifically for
this, so I thought I would ask the question here. If it's not possible, no
worries as I'll just write a script, but please let me know.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<configuration>
<sourceRoot>${basedir}/target/generated</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/service.wsdl</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>org.company.product</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg>service.wsdl</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Regards,
Bobby
Re: Header for Generated Code
Posted by Daniel Kulp <dk...@apache.org>.
On Thu July 9 2009 2:10:12 am jim ma wrote:
> There is no options for maven plugin to do this . But you can modify the
> velocity template to add some comments . Please look at the template files
> under this directory :
> org/apache/cxf/tools/wsdlto/frontend/jaxws/template
That won't apply to the JAXb generated things. I'm not sure there IS a
solution for that. Maybe an XJC plugin might be able to do it. Not really
sure.
Dan
>
> Jim.
>
> On Thu, Jul 9, 2009 at 5:36 AM, Bobby Warner <bo...@gmail.com> wrote:
> > Is there a way to easily add comments (like the apache license header (
> > http://www.apache.org/legal/src-headers.html for example) at the top of
> > all
> > wsdl2java generated classes? I could write a script to do this, but it
> > would be better if there was a way to do this as part of the Maven
> > plugin. I looked through the documentation and didn't see anything
> > specifically for this, so I thought I would ask the question here. If
> > it's not possible, no worries as I'll just write a script, but please let
> > me know.
> >
> > <plugin>
> > <groupId>org.apache.cxf</groupId>
> > <artifactId>cxf-codegen-plugin</artifactId>
> > <executions>
> > <execution>
> > <id>generate-sources</id>
> > <configuration>
> > <sourceRoot>${basedir}/target/generated</sourceRoot>
> > <wsdlOptions>
> > <wsdlOption>
> > <wsdl>${basedir}/src/main/resources/service.wsdl</wsdl>
> > <extraargs>
> > <extraarg>-p</extraarg>
> > <extraarg>org.company.product</extraarg>
> > <extraarg>-wsdlLocation</extraarg>
> > <extraarg>service.wsdl</extraarg>
> > </extraargs>
> > </wsdlOption>
> > </wsdlOptions>
> > </configuration>
> > <goals>
> > <goal>wsdl2java</goal>
> > </goals>
> > </execution>
> > </executions>
> > </plugin>
> >
> >
> > Regards,
> > Bobby
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Header for Generated Code
Posted by jim ma <ma...@gmail.com>.
There is no options for maven plugin to do this . But you can modify the
velocity template to add some comments . Please look at the template files
under this directory :
org/apache/cxf/tools/wsdlto/frontend/jaxws/template
Jim.
On Thu, Jul 9, 2009 at 5:36 AM, Bobby Warner <bo...@gmail.com> wrote:
> Is there a way to easily add comments (like the apache license header (
> http://www.apache.org/legal/src-headers.html for example) at the top of
> all
> wsdl2java generated classes? I could write a script to do this, but it
> would be better if there was a way to do this as part of the Maven plugin.
> I looked through the documentation and didn't see anything specifically for
> this, so I thought I would ask the question here. If it's not possible, no
> worries as I'll just write a script, but please let me know.
>
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <executions>
> <execution>
> <id>generate-sources</id>
> <configuration>
> <sourceRoot>${basedir}/target/generated</sourceRoot>
> <wsdlOptions>
> <wsdlOption>
> <wsdl>${basedir}/src/main/resources/service.wsdl</wsdl>
> <extraargs>
> <extraarg>-p</extraarg>
> <extraarg>org.company.product</extraarg>
> <extraarg>-wsdlLocation</extraarg>
> <extraarg>service.wsdl</extraarg>
> </extraargs>
> </wsdlOption>
> </wsdlOptions>
> </configuration>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
>
> Regards,
> Bobby
>