[ 
https://issues.apache.org/jira/browse/CXF-5479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13973856#comment-13973856
 ] 

Freeman Fang edited comment on CXF-5479 at 4/18/14 7:37 AM:
------------------------------------------------------------

Hi Sergey,

Just appended a CXF-5479-doclet.patch

In this patch, there's a  ParseJavaDocMojo which works on "generate-sources" 
phase, this maven mojo  invoke DumpJavaDoc doclet which parse the source files 
and save the java doc comments into a target/site/apidocs/dumpFile.properties, 
with a pattern like
className=classComment
className.operationName=operationComment
className.operationName.returnCommentTag=return tag  value
className.operationName.paramCommentTag.paraIndex=param tag value

And add DumpedDocFileProvider implementing the DocumentationProvider which can 
read dumpFile.properties and generate WADL with "Doc" in Java2WADLMojo.

So now the plugin configuration looks like
{code}
<plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-java2wadl-plugin</artifactId>
                <version>3.0.0-SNAPSHOT</version>
                <executions>
                    <execution>
                        <id>parsejavadoc</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>parsejavadoc</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>process-classes</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>java2wadl</goal>
                        </goals>
                        <configuration>
                            <classResourceNames>
                                    
<classResourceName>a.b.c.CustomerService</classResourceName>
                            </classResourceNames>
                            
<docProvider>org.apache.cxf.jaxrs.model.wadl.DumpedDocFileProvider</docProvider>
                            <attachWadl>true</attachWadl>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
{code}

So now the org.apache.cxf.jaxrs.model.wadl.DumpedDocFileProvider can easily 
pick up the saved dumpFile.properties and add docs into the wadl.

Any input is appreciated.

Cheers
Freeman


was (Author: ffang):
Hi Sergey,

Just appended a CXF-5479-doclet.patch

In this patch, there's a  ParseJavaDocMojo which works on "generate-sources" 
phase, this maven mojo  invoke DumpJavaDoc doclet which parse the source files 
and save the java doc comments into a target/site/apidocs/dumpFile.properties, 
with a pattern like
className=classComment
className.operationName=operationComment
className.operationName.returnCommentTag=return tag  value
className.operationName.paramCommentTag.paraIndex=param tag value

And add DumpedDocFileProvider implementing the DocumentationProvider which can 
read dumpFile.properties and generate WADL with "Doc" in Java2WADLMojo.

So now the plugin configuration looks like
{code}
<plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-java2wadl-plugin</artifactId>
                <version>3.0.0-SNAPSHOT</version>
                <executions>
                    <execution>
                        <id>parsejavadoc</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>parsejavadoc</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>process-classes</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>java2wadl</goal>
                        </goals>
                        <configuration>
                            <classResourceNames>
                                    
<classResourceName>a.b.c.CustomerService</classResourceName>
                            </classResourceNames>
                            
<docProvider>org.apache.cxf.jaxrs.model.wadl.DumpedDocFileProvider</docProvider>
                            <attachWadl>true</attachWadl>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
{code}

Any input is appreciated.

Cheers
Freeman

> Create a Maven plugin for generating WADL at build time
> -------------------------------------------------------
>
>                 Key: CXF-5479
>                 URL: https://issues.apache.org/jira/browse/CXF-5479
>             Project: CXF
>          Issue Type: New Feature
>          Components: JAX-RS
>            Reporter: Sergey Beryozkin
>            Assignee: Freeman Fang
>         Attachments: CXF-5479-doclet.patch, CXF-5479.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to