users@jersey.java.net

Re: [Jersey] WADL + Ant

From: Martin Grotzke <martin.grotzke_at_freiheit.com>
Date: Fri, 27 Feb 2009 10:37:03 +0100

You should use the task provided by Andrew. I'm not sure if he sent it
to this list once, however I have it attached to this mail (it's still
on my commit queue to the contribs stuff).

The task-def might look like this (if you're using jdk 1.5 you should
add jaxb-api-2.1.jar):

<taskdef name="generatewadl" classname="com.sun.jersey.wadl.GenerateWadlTask">
  <classpath>
    <fileset dir="${maven.repo.local}">
      <include name="com/sun/jersey/contribs/ant-wadl-task/${jersey-release-version}/ant-wadl-task-${jersey-release-version}.jar"/>
      <include name="com/sun/jersey/jersey-server/${jersey-release-version}/jersey-server-${jersey-release-version}.jar"/>
      <include name="com/sun/jersey/jersey-core/${jersey-release-version}/jersey-core-${jersey-release-version}.jar"/>
      <include name="javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar"/>
      <include name="xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar"/>
      <include name="asm/asm/3.1/asm-3.1.jar"/>
    </fileset>
  </classpath>
</taskdef>

The target should look like this:

<target name="wadl" depends="compile, resourcedoc" description="Generate wadl doc">
   <mkdir dir="${maven.build.dir}" />
   <generatewadl wadlFile="${maven.build.dir}/application.wadl" formatWadlFile="true" baseUri="http://www.example.org">
       <classpath>
           <!-- have to add the path to your compiled resources as well! -->
           <pathelement location="${maven.build.outputDir}" />
           <path refid="build.classpath.fixed" />
       </classpath>
       <packages>
           <package name="com.sun.jersey.samples.generatewadl.resources" />
       </packages>
       <wadlGenerators>
           <wadlGeneratorDescription name="com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport">
               <param name="resourceDocFile" value="${maven.build.dir}/resourcedoc.xml" />
           </wadlGeneratorDescription>
       </wadlGenerators>
   </generatewadl>
</target>

Please change all file references and variables to your needs.

Cheers,
Martin


On Fri, 2009-02-27 at 00:53 -0800, cquiroz wrote:
> Hi
>
> I just copied the build.xml snippet and it works for the most part
> except adding the xml file generated using the ResourcedDoclet
>
> <generatewadl wadlFile="${build}/classes/
> wadl/application.wadl"
> formatWadlFile="true" baseUri="<base_uri>">
> <wadlGenerators>
> <wadlGeneratorDescription
> name="com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport">
>
> </wadlGeneratorDescription>
> </wadlGenerators>
> </generatewadl>
>
> The task available in jersery 1.0.2 doesn't suppport the
> <wadlGenerators> element
>
> Carlos
>
>
> On Fri, Feb 27, 2009 at 1:08 AM, Andrew Ochsner (via Nabble) <ml-user%
> 2B110154-694370125@...> wrote:
> I'm also happy to dive in and help as I created and have been
> using it for a bit now... While I totally know it's limited
> (does just enough for me but thought it was good enough that
> others might find it useful).
>
> So the example I gave is exactly what I have and it works fine
> using the extended javadoc tags.
>
> Not sure what you mean that it doesn't support hte sub
> component wadlGenerators...could you maybe post the snippet of
> your build.xml?
>
> Thanks
> Andy O
>
>
> On Thu, Feb 26, 2009 at 7:45 AM, Paul Sandoz <Paul.Sandoz@...>
> wrote:
>
> On Feb 26, 2009, at 12:15 PM, cquiroz wrote:
>
>
> Hi
>
> First of all thanks to all the jersey authors,
> this is one of the most
> enjoyable frameworks I have ever used, great
> design!
>
>
>
> Thanks!
>
>
>
> Now into my question, I tried to follow the
> ant task example as below since
> I want to create the REST documentation based
> on the code.
>
> However, the current code (jersey 1.0.2)
> doesn't work as indicated below. I
> can correctly create the docs but to use the
> extended javadoc tags I'd need
> to pass the resource.xml file as indicated in
> this example.
>
> It seems that the wadl task in 1.0.2 doesn't
> support the sub component
> wadlGenerators.
>
>
> Yes, the Ant task is rather limited.
>
>
>
> Do you have any suggestions, is this coming in
> the next
> version?
>
>
>
> Could you log an issue. We will try and fix it for the
> next release (end of March start of April time-frame).
>
> Thanks,
> Paul.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>
>
>
>
>
>
> ______________________________________________________________________
> View this message in context: Re: [Jersey] WADL + Ant
> Sent from the Jersey mailing list archive at Nabble.com.
-- 
Martin Grotzke
http://www.javakaffee.de/blog/