Add swagger.json as discovery release artifacts
[msb/discovery.git] / sdclient / discovery-service / pom.xml
index 982338d..a1b93ec 100644 (file)
                        <artifactId>guava</artifactId>
                        <version>${guava.version}</version>
                </dependency>
-
        </dependencies>
        <build>
                <plugins>
+                       <!-- JSON -->
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>properties-maven-plugin</artifactId>
+                               <version>1.0.0</version>
+                               <executions>
+                                       <execution>
+                                               <phase>initialize</phase>
+                                               <goals>
+                                                       <goal>read-project-properties</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <files>
+                                                               <file>${basedir}/src/main/resources/swagger.properties</file>
+                                                       </files>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>com.github.kongchen</groupId>
+                               <artifactId>swagger-maven-plugin</artifactId>
+                               <version>3.1.4</version>
+                               <configuration>
+                                       <apiSources>
+                                               <apiSource>
+                                                       <locations>${api-rest-package}</locations>
+                                                       <schemes>
+                                                               <scheme>http</scheme>
+                                                               <scheme>https</scheme>
+                                                       </schemes>
+                                                       <host>${api-host-ip}:${api-host-port}</host>
+                                                       <basePath>${api-base-path}</basePath>
+                                                       <info>
+                                                               <title>${api-title}</title>
+                                                               <version>${api-version}</version>
+                                                               <description>${api-description}</description>
+                                                               <license>
+                                                                       <name>${api-license}</name>
+                                                               </license>
+                                                       </info>
+                                                       <!--<swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>-->
+                                                       <swaggerDirectory>${basedir}/target/classes</swaggerDirectory>
+                                               </apiSource>
+                                       </apiSources>
+                               </configuration>
+                               <executions>
+                                       <execution>
+                                               <phase>compile</phase>
+                                               <goals>
+                                                       <goal>generate</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>build-helper-maven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>attach-artifacts</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>attach-artifact</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <artifacts>
+                                                               <artifact>
+                                                                       <file>target/classes/swagger.json</file>
+                                                                       <type>json</type>
+                                                                       <classifier>schema</classifier>
+                                                               </artifact>
+                                                       </artifacts>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>