-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate documentation from Swagger annotations
- Loading branch information
Showing
12 changed files
with
334 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.coremedia.labs</groupId> | ||
<artifactId>headless-server</artifactId> | ||
<version>1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>headless-server-doc</artifactId> | ||
|
||
<description>Headless Server API Documentation</description> | ||
|
||
<properties> | ||
<asciidoctorj-pdf.version>1.5.0-alpha.16</asciidoctorj-pdf.version> | ||
<asciidoctor-maven-plugin.version>1.5.6</asciidoctor-maven-plugin.version> | ||
<jruby.version>9.1.15.0</jruby.version> | ||
<swagger2markup.version>1.3.1</swagger2markup.version> | ||
|
||
<swagger.output.dir>${project.build.directory}/swagger</swagger.output.dir> | ||
<swagger.snippetOutput.dir>${project.build.directory}/asciidoc/snippets</swagger.snippetOutput.dir> | ||
<swagger.input>${swagger.output.dir}/swagger.json</swagger.input> | ||
<asciidoctor.input.directory>${project.basedir}/src/docs/asciidoc</asciidoctor.input.directory> | ||
<asciidoc.generated.output.directory>${project.build.directory}/asciidoc/generated</asciidoc.generated.output.directory> | ||
<asciidoctor.html.output.directory>${project.build.directory}/asciidoc/html</asciidoctor.html.output.directory> | ||
<asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- third-party libs --> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- scope test --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.vaadin.external.google</groupId> | ||
<artifactId>android-json</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.restdocs</groupId> | ||
<artifactId>spring-restdocs-mockmvc</artifactId> | ||
<version>${spring-restdocs.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.coremedia.labs</groupId> | ||
<artifactId>headless-server-core</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<resources> | ||
<resource> | ||
<directory>${asciidoctor.html.output.directory}</directory> | ||
</resource> | ||
<resource> | ||
<directory>${asciidoctor.pdf.output.directory}</directory> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<content-server.host>${installation.server.host}</content-server.host> | ||
<content-server.port>${installation.server.port}</content-server.port> | ||
<io.springfox.staticdocs.outputDir>${swagger.output.dir}</io.springfox.staticdocs.outputDir> | ||
<io.springfox.staticdocs.snippetsOutputDir>${swagger.snippetOutput.dir}</io.springfox.staticdocs.snippetsOutputDir> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
<!-- use swagger2markup plugin to generate asciidoc --> | ||
<plugin> | ||
<groupId>io.github.swagger2markup</groupId> | ||
<artifactId>swagger2markup-maven-plugin</artifactId> | ||
<version>${swagger2markup.version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.github.swagger2markup</groupId> | ||
<artifactId>swagger2markup-import-files-ext</artifactId> | ||
<version>${swagger2markup.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.github.swagger2markup</groupId> | ||
<artifactId>swagger2markup-spring-restdocs-ext</artifactId> | ||
<version>${swagger2markup.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<swaggerInput>${swagger.input}</swaggerInput> | ||
<outputDir>${asciidoc.generated.output.directory}</outputDir> | ||
<config> | ||
<swagger2markup.markupLanguage>ASCIIDOC</swagger2markup.markupLanguage> | ||
<swagger2markup.pathsGroupedBy>TAGS</swagger2markup.pathsGroupedBy> | ||
<swagger2markup.extensions.dynamicOverview.contentPath>${project.basedir}/src/docs/asciidoc/extensions/overview</swagger2markup.extensions.dynamicOverview.contentPath> | ||
<swagger2markup.extensions.dynamicDefinitions.contentPath>${project.basedir}/src/docs/asciidoc/extensions/definitions</swagger2markup.extensions.dynamicDefinitions.contentPath> | ||
<swagger2markup.extensions.dynamicPaths.contentPath>${project.basedir}/src/docs/asciidoc/extensions/paths</swagger2markup.extensions.dynamicPaths.contentPath> | ||
<swagger2markup.extensions.dynamicSecurity.contentPath>${project.basedir}src/docs/asciidoc/extensions/security/</swagger2markup.extensions.dynamicSecurity.contentPath> | ||
<swagger2markup.extensions.springRestDocs.snippetBaseUri>${swagger.snippetOutput.dir}</swagger2markup.extensions.springRestDocs.snippetBaseUri> | ||
<swagger2markup.extensions.springRestDocs.defaultSnippets>true</swagger2markup.extensions.springRestDocs.defaultSnippets> | ||
</config> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>convertSwagger2markup</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- run generated asciidoc through Asciidoctor to generate HTML and PDF output --> | ||
<plugin> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctor-maven-plugin</artifactId> | ||
<version>${asciidoctor-maven-plugin.version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctorj-pdf</artifactId> | ||
<version>${asciidoctorj-pdf.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby-complete</artifactId> | ||
<version>${jruby.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<!-- configure generic document settings --> | ||
<configuration> | ||
<sourceDirectory>${asciidoctor.input.directory}</sourceDirectory> | ||
<sourceDocumentName>index.adoc</sourceDocumentName> | ||
<attributes> | ||
<doctype>book</doctype> | ||
<toc>left</toc> | ||
<toclevels>3</toclevels> | ||
<numbered/> | ||
<hardbreaks/> | ||
<sectlinks/> | ||
<sectanchors/> | ||
<generated>${asciidoc.generated.output.directory}</generated> | ||
</attributes> | ||
</configuration> | ||
<!-- generate HTML and PDF --> | ||
<executions> | ||
<execution> | ||
<id>output-html</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>process-asciidoc</goal> | ||
</goals> | ||
<configuration> | ||
<backend>html5</backend> | ||
<outputDirectory>${asciidoctor.html.output.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>output-pdf</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>process-asciidoc</goal> | ||
</goals> | ||
<configuration> | ||
<backend>pdf</backend> | ||
<outputDirectory>${asciidoctor.pdf.output.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- copy generated output to jar --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-resources</id> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.outputDirectory}/static/docs</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>${asciidoctor.html.output.directory}</directory> | ||
</resource> | ||
<resource> | ||
<directory>${asciidoctor.pdf.output.directory}</directory> | ||
</resource> | ||
<resource> | ||
<directory>${swagger.output.dir}</directory> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.