<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>cps-rest</artifactId> | |
<parent> | |
<groupId>org.onap.cps</groupId> | |
<artifactId>cps</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
</parent> | |
<dependencies> | |
<dependency> | |
<groupId>org.onap.cps</groupId> | |
<artifactId>cps-service</artifactId> | |
<version>${project.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.onap.cps</groupId> | |
<artifactId>cps-ri</artifactId> | |
<version>${project.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.jersey.media</groupId> | |
<artifactId>jersey-media-multipart</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-webmvc</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-jersey</artifactId> | |
<exclusions> | |
<exclusion> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-jetty</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>io.swagger.core.v3</groupId> | |
<artifactId>swagger-annotations</artifactId> | |
<version>${swagger.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.swagger.core.v3</groupId> | |
<artifactId>swagger-jaxrs2</artifactId> | |
<version>${swagger.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-test</artifactId> | |
<scope>test</scope> | |
<exclusions> | |
<exclusion> | |
<groupId>org.junit.vintage</groupId> | |
<artifactId>junit-vintage-engine</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<!-- Used by the generated API --> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-bundle-jaxrs</artifactId> | |
<version>${cxf-bundle-jaxrs.version}</version> | |
</dependency> | |
<!-- Used by the generated API --> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-rt-rs-service-description</artifactId> | |
<version>${cxf-rt-rs-service.version}</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<version>${springboot.version}</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>repackage</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>io.swagger.codegen.v3</groupId> | |
<artifactId>swagger-codegen-maven-plugin</artifactId> | |
<version>${swagger-codegen.version}</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>generate</goal> | |
</goals> | |
<configuration> | |
<inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec> | |
<invokerPackage>org.onap.cps.rest.controller</invokerPackage> | |
<modelPackage>org.onap.cps.rest.model</modelPackage> | |
<apiPackage>org.onap.cps.rest.controller</apiPackage> | |
<language>jaxrs-cxf</language> | |
<generateSupportingFiles>true</generateSupportingFiles> | |
<configOptions> | |
<sourceFolder>src/gen/java</sourceFolder> | |
<dateLibrary>java8</dateLibrary> | |
<library>jersey2</library> | |
<interfaceOnly>true</interfaceOnly> | |
</configOptions> | |
</configuration> | |
</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> |