diff options
author | liamfallon <liam.fallon@est.tech> | 2021-07-14 17:52:12 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2021-07-15 14:58:20 +0100 |
commit | 3605d0a0dc7a022059db0db6f0394f02cbf967fd (patch) | |
tree | b33cb0271aa0aeda553497101b270e02259d5cf2 | |
parent | 258fdc2ddb8b5e130ccc2b287c10c3fd782b7ee9 (diff) |
Replace swagger doc gen with commmon approach
The swagger documentation generation is moved to policy-parent. This
commit removes the CLAMP swagger document generation and replaces it
with the common handling.
It also fixes the following bug:
The current CLAMP build generates the swagger.json file using a unit
test case. That file is used later in the build to generate a
swagger.pdf and swagger.html file. If the tests are skipped, the
swagger.json file is not generated and the build fails on the PDF/html
generation step.
This change adds a profile to the build that only does the PDF/html
generation when the skipTests flag is off.
Issue-ID: POLICY-3424
Change-Id: Id195fc600d8fca7bfa5d9003272520d57414d646
Signed-off-by: liamfallon <liam.fallon@est.tech>
-rw-r--r-- | runtime/pom.xml | 91 | ||||
-rw-r--r-- | runtime/src/main/resources/asciidoc/swagger.adoc | 4 |
2 files changed, 4 insertions, 91 deletions
diff --git a/runtime/pom.xml b/runtime/pom.xml index 4c8bf24f9..d55c2cab8 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -97,6 +97,9 @@ <ui.react.src>ui-react</ui.react.src> <ui.react.lib.src>ui-react-lib</ui.react.lib.src> <npm.publish.url>https://nexus3.onap.org/repository/npm.snapshot/</npm.publish.url> + + <!-- This property triggers generation of the Swagger documents --> + <swagger.generation.phase>post-integration-test</swagger.generation.phase> </properties> <profiles> @@ -152,6 +155,7 @@ </properties> </profile> </profiles> + <dependencyManagement> <dependencies> <dependency> @@ -570,94 +574,7 @@ </executions> </plugin> - <!-- Read the swagger.json file and the definition from SwaggerConfig.java; generate - a list of .adoc files containing the APIs info in more structured way --> - <plugin> - <groupId>io.github.swagger2markup</groupId> - <artifactId>swagger2markup-maven-plugin</artifactId> - <version>1.3.3</version> - <dependencies> - <dependency> - <groupId>io.github.swagger2markup</groupId> - <artifactId>swagger2markup-import-files-ext</artifactId> - <version>1.3.3</version> - </dependency> - <dependency> - <groupId>io.github.swagger2markup</groupId> - <artifactId>swagger2markup-spring-restdocs-ext</artifactId> - <version>1.3.3</version> - </dependency> - </dependencies> - <configuration> - <swaggerInput>${project.build.directory}/swagger/swagger.json</swaggerInput> - <outputDir>${project.build.directory}/asciidoc/generated</outputDir> - <config> - <swagger2markup.markupLanguage>ASCIIDOC</swagger2markup.markupLanguage> - </config> - </configuration> - <executions> - <execution> - <phase>post-integration-test</phase> - <goals> - <goal>convertSwagger2markup</goal> - </goals> - </execution> - </executions> - </plugin> - - <!-- Run the generated asciidoc through Asciidoctor to generate other documentation - types, such as PDFs or HTML5 --> - <plugin> - <groupId>org.asciidoctor</groupId> - <artifactId>asciidoctor-maven-plugin</artifactId> - <version>1.5.7.1</version> - <dependencies> - <dependency> - <groupId>org.asciidoctor</groupId> - <artifactId>asciidoctorj-pdf</artifactId> - <version>1.5.0-alpha.10.1</version> - </dependency> - </dependencies> - <configuration> - <sourceDirectory>${project.basedir}/src/main/resources/asciidoc</sourceDirectory> - <sourceDocumentName>swagger.adoc</sourceDocumentName> - <attributes> - <doctype>book</doctype> - <toc>left</toc> - <toclevels>3</toclevels> - <numbered/> - <hardbreaks/> - <sectlinks/> - <sectanchors/> - <generated>${project.build.directory}/asciidoc/generated</generated> - </attributes> - </configuration> - <executions> - <execution> - <id>output-html</id> - <phase>post-integration-test</phase> - <goals> - <goal>process-asciidoc</goal> - </goals> - <configuration> - <backend>html5</backend> - <outputDirectory>${project.build.directory}/swagger</outputDirectory> - </configuration> - </execution> - <execution> - <id>output-pdf</id> - <phase>post-integration-test</phase> - <goals> - <goal>process-asciidoc</goal> - </goals> - <configuration> - <backend>pdf</backend> - <outputDirectory>${project.build.directory}/swagger</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> <plugin> <groupId>org.codehaus.groovy.maven</groupId> <artifactId>gmaven-plugin</artifactId> diff --git a/runtime/src/main/resources/asciidoc/swagger.adoc b/runtime/src/main/resources/asciidoc/swagger.adoc deleted file mode 100644 index 6896747fd..000000000 --- a/runtime/src/main/resources/asciidoc/swagger.adoc +++ /dev/null @@ -1,4 +0,0 @@ -include::{generated}/overview.adoc[] -include::{generated}/paths.adoc[] -include::{generated}/security.adoc[] -include::{generated}/definitions.adoc[]
\ No newline at end of file |