]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1683] Automatic generation of REST Api documentation.
authorOlivier Lamy <olamy@apache.org>
Thu, 4 Oct 2012 22:49:11 +0000 (22:49 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 4 Oct 2012 22:49:11 +0000 (22:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1394312 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Dependency.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
archiva-modules/archiva-web/archiva-rest/pom.xml

index e0956c40014373539ba04136cef9eaab0848fdd9..199485f35014e42ef8fbd0634bb2a9ea035cc480 100644 (file)
   <packaging>bundle</packaging>
   <name>Archiva Web :: REST support :: Api</name>
 
+  <properties>
+    <enunciate.version>1.26.1</enunciate.version>
+    <enunciate.debug>false</enunciate.debug>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.archiva</groupId>
         </exclusion>
       </exclusions>
     </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.enunciate</groupId>
+      <artifactId>enunciate-core</artifactId>
+      <scope>provided</scope>
+      <version>${enunciate.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-xc</artifactId>
+      <version>${jacksonVersion}</version>
+      <scope>provided</scope>
+    </dependency>
+
   </dependencies>
 
   <build>
           </execution>
         </executions>
       </plugin>
+
+
+     <plugin>
+       <groupId>org.codehaus.enunciate</groupId>
+       <artifactId>maven-enunciate-plugin</artifactId>
+       <version>${enunciate.version}</version>
+       <executions>
+         <execution>
+           <phase>process-classes</phase>
+           <goals>
+             <goal>docs</goal>
+           </goals>
+         </execution>
+       </executions>
+       <configuration>
+         <docsDir>${project.build.outputDirectory}/docs</docsDir>
+         <configFile>src/enunciate/enunciate.xml</configFile>
+         <compileDebug>${enunciate.debug}</compileDebug>
+       </configuration>
+       <dependencies>
+         <dependency>
+           <groupId>org.codehaus.enunciate</groupId>
+           <artifactId>enunciate-docs</artifactId>
+           <version>${enunciate.version}</version>
+         </dependency>
+       </dependencies>
+     </plugin>
+
     </plugins>
   </build>
 
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
new file mode 100644 (file)
index 0000000..d0d195e
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
+
+  <services>
+    <rest defaultRestSubcontext="restServices"/>
+  </services>
+
+  <modules>
+
+    <cxf disabled="false"/>
+    <jersey disabled="true" />
+    <c disabled="true"/>
+    <csharp disabled="true"/>
+    <obj-c disabled="true"/>
+    <jaxws-ri disabled="true"/>
+    <jaxws-support disabled="true"/>
+
+    <docs disabled="false" title="Apache Archiva REST API" includeExampleXml="true" includeExampleJson="true"
+          includeDefaultDownloads="false">
+      <war docsDir="apidocs" />
+    </docs>
+
+  </modules>
+
+</enunciate>
\ No newline at end of file
index 2064ad27fea26b5535325a890bba2dfe384d0c5b..c02b734549e639f34a73e16faa47eb5c13a5c84f 100644 (file)
@@ -38,6 +38,12 @@ public class Dependency
 
     private String scope;
 
+    public Dependency()
+    {
+        // no op
+    }
+
+
     public Dependency( String groupId, String artifactId, String version, String classifier, String type, String scope )
     {
         this.groupId = groupId;
index 5d518009a357d92fe6c2fec1d0376af252ea2782..735ea9279f317fbe0af67c3ca4a06d89c4a717d3 100644 (file)
@@ -58,6 +58,10 @@ public interface BrowseService
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization (noPermission = true, noRestriction = true)
+    /**
+     * @param groupId groupId to browse
+     * @param repositoryId optionnal (repository to browse if <code>null</code> all available user repositories are used)
+     */
     BrowseResult browseGroupId( @PathParam ("groupId") String groupId,
                                 @QueryParam ("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
index 71de4b4d7fd1ffefe3e0f3bff6ccf0991824ac8d..347cc45a2ca849c334196cd41182c0bdb499cbcf 100644 (file)
@@ -30,5 +30,6 @@
   <modules>
     <module>archiva-rest-api</module>
     <module>archiva-rest-services</module>
+    <module>archiva-rest-documentor</module>
   </modules>
 </project>
\ No newline at end of file