Browse Source

Added Enunciate to automatically create REST APIs documentation

feature/22999
Luca Frosini 3 months ago
parent
commit
8f6a7397a9
  1. 1
      CHANGELOG.md
  2. 23
      enunciate.xml
  3. 1
      gcube/extra-resources/WEB-INF/gcube-app.xml
  4. 69
      pom.xml

1
CHANGELOG.md

@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added support to manage configurations [#22658]
- Migrated service to SecretManagerProvider [#22871]
- Migrated to ServiceClass corresponding to Maven groupId
- Added Enunciate to automatically create REST APIs documentation [#23096]
## [v2.1.0]

23
enunciate.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<enunciate
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.14.0.xsd">
<api-classes>
<!-- Use patterns to exclude classes...
e.g. for URI-Resolver
<exclude pattern="org.gcube.datatransfer.resolver.services.UriResolverDocs" />
<exclude pattern="org.gcube.datatransfer.resolver.services.UriResolverIndex" />
<exclude pattern="org.gcube.datatransfer.resolver.services.UriResolverInfo" />
<exclude pattern="org.gcube.datatransfer.resolver.services.tobackward.BackCatalogueResolver" />
<exclude pattern="org.gcube.datatransfer.resolver.services.tobackward.BackUriResolverCatalogueResolver" />
-->
</api-classes>
<modules>
<gwt-json-overlay disabled="true " />
<php-json-client disabled="true" />
<ruby-json-client disabled="true" />
<java-json-client disabled="true" />
<javascript-client disabled="true" />
<docs docsDir="${project.build.directory}" docsSubdir="docs" />
</modules>
</enunciate>

1
gcube/extra-resources/WEB-INF/gcube-app.xml

@ -5,4 +5,5 @@
<group>${project.groupId}</group>
<version>${project.version}</version>
<description>${project.description}</description>
<exclude>/docs/*</exclude>
</application>

69
pom.xml

@ -22,6 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<webappDirectory>${project.basedir}${file.separator}src${file.separator}main${file.separator}webapp${file.separator}WEB-INF</webappDirectory>
<serviceClass>data-catalogue</serviceClass>
<enunciate.version>2.14.0</enunciate.version>
</properties>
<scm>
@ -97,8 +98,6 @@
<artifactId>resource-registry-publisher</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcubedatacatalogue-metadata-discovery</artifactId>
@ -208,6 +207,22 @@
<artifactId>gcube-jackson-databind</artifactId>
</dependency>
<!-- Required for Enunciate plugin -->
<dependency>
<groupId>org.geotoolkit</groupId>
<artifactId>geotk-xml-base</artifactId>
<version>3.20-geoapi-3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- END Required for Enunciate plugin -->
<!-- Test libraries -->
<dependency>
<groupId>junit</groupId>
@ -222,4 +237,54 @@
</dependency>
</dependencies>
<build>
<plugins>
<!-- Enunciate Maven plugin -->
<plugin>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<version>${enunciate.version}</version>
<configuration>
</configuration>
<executions>
<execution>
<id>assemble</id>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Copy Enunciate Documentation from your-application/docs into your war -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-enunciate-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<targetPath>${project.build.directory}/${project.artifactId}-${project.version}/docs</targetPath>
<directory>${project.build.directory}/docs</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Loading…
Cancel
Save