diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-04 22:49:11 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-04 22:49:11 +0000 |
commit | ded769cba91cd39284ee296eae35e8459158f1c9 (patch) | |
tree | 2fcc2a4880fe2d82b969e3bda527f66c0ca12c35 /archiva-modules/archiva-web/archiva-rest | |
parent | a329b5ae3c42796e1ab45fda021cb3a159a63120 (diff) | |
download | archiva-ded769cba91cd39284ee296eae35e8459158f1c9.tar.gz archiva-ded769cba91cd39284ee296eae35e8459158f1c9.zip |
[MRM-1683] Automatic generation of REST Api documentation.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1394312 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
5 files changed, 102 insertions, 0 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml index e0956c400..199485f35 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml @@ -28,6 +28,11 @@ <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> @@ -94,6 +99,21 @@ </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> @@ -136,6 +156,34 @@ </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 index 000000000..d0d195e7e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml @@ -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 diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Dependency.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Dependency.java index 2064ad27f..c02b73454 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Dependency.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Dependency.java @@ -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; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java index 5d518009a..735ea9279 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java @@ -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; diff --git a/archiva-modules/archiva-web/archiva-rest/pom.xml b/archiva-modules/archiva-web/archiva-rest/pom.xml index 71de4b4d7..347cc45a2 100644 --- a/archiva-modules/archiva-web/archiva-rest/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/pom.xml @@ -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 |