summaryrefslogtreecommitdiffstats
path: root/cps/cps-rest/pom.xml
diff options
context:
space:
mode:
Diffstat (limited to 'cps/cps-rest/pom.xml')
-rw-r--r--cps/cps-rest/pom.xml78
1 files changed, 78 insertions, 0 deletions
diff --git a/cps/cps-rest/pom.xml b/cps/cps-rest/pom.xml
index 2b4cbb894..274e57f52 100644
--- a/cps/cps-rest/pom.xml
+++ b/cps/cps-rest/pom.xml
@@ -29,6 +29,11 @@
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
<exclusions>
@@ -83,6 +88,79 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <!-- Download Swagger UI webjar. -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${maven-dependency-plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.webjars</groupId>
+ <artifactId>swagger-ui</artifactId>
+ <version>${swagger-ui.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/swagger-ui-${swagger-ui.version}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Copy Swagger UI resources to static resources directory. -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${maven-resources-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/static/swagger-ui</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/swagger-ui-${swagger-ui.version}/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/</directory>
+ <excludes>
+ <exclude>**/*.gz</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Replace the OpenAPI specification example URL with the local one. -->
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>replacer</artifactId>
+ <version>${maven-replacer-plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <file>${project.build.outputDirectory}/static/swagger-ui/index.html</file>
+ <replacements>
+ <replacement>
+ <token>https://petstore.swagger.io/v2/swagger.json</token>
+ <value>/api/cps/openapi.json</value>
+ </replacement>
+ </replacements>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>