|
@@ -171,36 +171,287 @@
|
|
|
<version>2.4</version>
|
|
|
</dependency>
|
|
|
|
|
|
+ <!--offline doc-->
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.springframework.restdocs</groupId>
|
|
|
+ <artifactId>spring-restdocs-mockmvc</artifactId>
|
|
|
+ <!--<scope>test</scope>-->
|
|
|
+ </dependency>
|
|
|
+ <dependency>
|
|
|
+ <groupId>io.github.swagger2markup</groupId>
|
|
|
+ <artifactId>swagger2markup-spring-restdocs-ext</artifactId>
|
|
|
+ <version>${swagger2markup.version}</version>
|
|
|
+ <scope>test</scope>
|
|
|
+ </dependency>
|
|
|
+ <dependency>
|
|
|
+ <groupId>io.springfox</groupId>
|
|
|
+ <artifactId>springfox-staticdocs</artifactId>
|
|
|
+ <version>2.6.1</version>
|
|
|
+ <!--<scope>test</scope>-->
|
|
|
+ </dependency>
|
|
|
</dependencies>
|
|
|
|
|
|
+ <repositories>
|
|
|
+ <repository>
|
|
|
+ <id>jcentral</id>
|
|
|
+ <name>bintray</name>
|
|
|
+ <url>http://jcenter.bintray.com</url>
|
|
|
+ <snapshots>
|
|
|
+ <enabled>false</enabled>
|
|
|
+ </snapshots>
|
|
|
+ </repository>
|
|
|
+ <repository>
|
|
|
+ <id>jcenter-snapshots</id>
|
|
|
+ <name>jcenter</name>
|
|
|
+ <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
|
|
|
+ </repository>
|
|
|
+ </repositories>
|
|
|
+
|
|
|
+ <pluginRepositories>
|
|
|
+ <pluginRepository>
|
|
|
+ <id>jcenter-snapshots</id>
|
|
|
+ <name>jcenter</name>
|
|
|
+ <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
|
|
|
+ </pluginRepository>
|
|
|
+ <pluginRepository>
|
|
|
+ <id>jcenter-releases</id>
|
|
|
+ <name>jcenter</name>
|
|
|
+ <url>http://jcenter.bintray.com</url>
|
|
|
+ <snapshots>
|
|
|
+ <enabled>false</enabled>
|
|
|
+ </snapshots>
|
|
|
+ </pluginRepository>
|
|
|
+ </pluginRepositories>
|
|
|
+
|
|
|
<build>
|
|
|
<plugins>
|
|
|
<plugin>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
</plugin>
|
|
|
- <!-- 添加docker-maven插件 -->
|
|
|
<plugin>
|
|
|
- <groupId>com.spotify</groupId>
|
|
|
- <artifactId>docker-maven-plugin</artifactId>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-compiler-plugin</artifactId>
|
|
|
+ <version>3.3</version>
|
|
|
+ <configuration>
|
|
|
+ <compilerVersion>${java.version}</compilerVersion>
|
|
|
+ <source>${java.version}</source>
|
|
|
+ <target>${java.version}</target>
|
|
|
+ <encoding>UTF-8</encoding>
|
|
|
+ <!-- prevents endPosTable exception for maven compile -->
|
|
|
+ <useIncrementalCompilation>false</useIncrementalCompilation>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-surefire-plugin</artifactId>
|
|
|
+ <configuration>
|
|
|
+ <systemPropertyVariables>
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <!-- First, use the 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>${generated.asciidoc.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 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.6</version>
|
|
|
+ <!-- Include Asciidoctor PDF for pdf generation -->
|
|
|
+ <dependencies>
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.asciidoctor</groupId>
|
|
|
+ <artifactId>asciidoctorj-pdf</artifactId>
|
|
|
+ <version>1.5.0-alpha.16</version>
|
|
|
+ </dependency>
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.jruby</groupId>
|
|
|
+ <artifactId>jruby-complete</artifactId>
|
|
|
+ <version>1.7.21</version>
|
|
|
+ </dependency>
|
|
|
+ </dependencies>
|
|
|
+ <!-- Configure generic document generation settings -->
|
|
|
+ <configuration>
|
|
|
+ <sourceDirectory>${asciidoctor.input.directory}</sourceDirectory>
|
|
|
+ <sourceDocumentName>index.adoc</sourceDocumentName>
|
|
|
+ <attributes>
|
|
|
+ <doctype>book</doctype>
|
|
|
+ <toc>left</toc>
|
|
|
+ <toclevels>3</toclevels>
|
|
|
+ <numbered></numbered>
|
|
|
+ <hardbreaks></hardbreaks>
|
|
|
+ <sectlinks></sectlinks>
|
|
|
+ <sectanchors></sectanchors>
|
|
|
+ <generated>${generated.asciidoc.directory}</generated>
|
|
|
+ </attributes>
|
|
|
+ </configuration>
|
|
|
+ <!-- Since each execution can only handle one backend, run
|
|
|
+ separate executions for each desired output type -->
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <!-- specify the main class for the manifest -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-jar-plugin</artifactId>
|
|
|
+ <version>3.1.0</version>
|
|
|
<configuration>
|
|
|
- <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
|
|
|
- <forceTags>true</forceTags>
|
|
|
- <!--镜像的FROM,使用压缩的小镜像-->
|
|
|
- <baseImage>frolvlad/alpine-oraclejre8:slim</baseImage>
|
|
|
- <entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>
|
|
|
- <resources>
|
|
|
- <resource>
|
|
|
- <targetPath>/</targetPath>
|
|
|
- <directory>${project.build.directory}</directory>
|
|
|
- <include>${project.build.finalName}.jar</include>
|
|
|
- </resource>
|
|
|
- </resources>
|
|
|
- <serverId>docker-registry</serverId>
|
|
|
- <registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>
|
|
|
+ <archive>
|
|
|
+ <manifest>
|
|
|
+ <addClasspath>true</addClasspath>
|
|
|
+ <classpathPrefix>lib/</classpathPrefix>
|
|
|
+ <!--important!!! specify the main class for the manifest!!!-->
|
|
|
+ <!--important!!! specify the main class for the manifest!!!-->
|
|
|
+ <!--important!!! specify the main class for the manifest!!!-->
|
|
|
+ <mainClass>com.chinamobile.cmic.apidoc.ApiDocApplication</mainClass>
|
|
|
+ </manifest>
|
|
|
+ </archive>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
+
|
|
|
+ <!-- copy dependencies to the lib directory -->
|
|
|
+ <plugin>
|
|
|
+ <artifactId>maven-dependency-plugin</artifactId>
|
|
|
+ <executions>
|
|
|
+ <execution>
|
|
|
+ <phase>package</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>copy-dependencies</goal>
|
|
|
+ </goals>
|
|
|
+ <configuration>
|
|
|
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- copy the generated documents -->
|
|
|
+ <plugin>
|
|
|
+ <artifactId>maven-resources-plugin</artifactId>
|
|
|
+ <version>3.1.0</version>
|
|
|
+ <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>
|
|
|
+ </resources>
|
|
|
+ </configuration>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
|
|
|
+ <!--<build>-->
|
|
|
+ <!--<plugins>-->
|
|
|
+ <!--<plugin>-->
|
|
|
+ <!--<groupId>org.springframework.boot</groupId>-->
|
|
|
+ <!--<artifactId>spring-boot-maven-plugin</artifactId>-->
|
|
|
+ <!--</plugin>-->
|
|
|
+ <!--<!– 添加docker-maven插件 –>-->
|
|
|
+ <!--<plugin>-->
|
|
|
+ <!--<groupId>com.spotify</groupId>-->
|
|
|
+ <!--<artifactId>docker-maven-plugin</artifactId>-->
|
|
|
+ <!--<configuration>-->
|
|
|
+ <!--<imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>-->
|
|
|
+ <!--<forceTags>true</forceTags>-->
|
|
|
+ <!--<!–镜像的FROM,使用压缩的小镜像–>-->
|
|
|
+ <!--<baseImage>frolvlad/alpine-oraclejre8:slim</baseImage>-->
|
|
|
+ <!--<entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>-->
|
|
|
+ <!--<resources>-->
|
|
|
+ <!--<resource>-->
|
|
|
+ <!--<targetPath>/</targetPath>-->
|
|
|
+ <!--<directory>${project.build.directory}</directory>-->
|
|
|
+ <!--<include>${project.build.finalName}.jar</include>-->
|
|
|
+ <!--</resource>-->
|
|
|
+ <!--</resources>-->
|
|
|
+ <!--<serverId>docker-registry</serverId>-->
|
|
|
+ <!--<registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>-->
|
|
|
+ <!--</configuration>-->
|
|
|
+ <!--</plugin>-->
|
|
|
+ <!--</plugins>-->
|
|
|
+ <!--</build>-->
|
|
|
+
|
|
|
</project>
|