<?xml version="1.0"?>
<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>

    <artifactId>multiapps-controller-api</artifactId>
    <packaging>jar</packaging>
    <name>MultiApps Controller API</name>

    <parent>
        <groupId>org.cloudfoundry.multiapps</groupId>
        <artifactId>multiapps-controller-parent</artifactId>
        <version>1.197.0</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.cloudfoundry.multiapps</groupId>
            <artifactId>multiapps-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.cloudfoundry.multiapps</groupId>
            <artifactId>multiapps-mta</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <!-- Required by swagger-maven-plugin during compile  -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <configuration>
                    <skipSwaggerGeneration>false</skipSwaggerGeneration>
                    <apiSources>
                        <apiSource>
                            <springmvc>true</springmvc>
                            <schemes>https</schemes>
                            <info>
                                <contact>
                                    <email></email>
                                </contact>
                                <license>
                                    <name>Apache 2.0</name>
                                    <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
                                </license>
                            </info>
                            <outputFormats>yaml</outputFormats>
                            <swaggerDirectory>${project.basedir}/src/main/resources</swaggerDirectory>
                            <securityDefinitions>
                                <securityDefinition>
                                    <jsonPath>${project.basedir}/src/main/resources/securityDefinition.json</jsonPath>
                                </securityDefinition>
                            </securityDefinitions>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <id>api-doc</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <apiSources>
                                <apiSource>
                                    <locations>org.cloudfoundry.multiapps.controller.api.v1</locations>
                                    <swaggerFileName>mtarest</swaggerFileName>
                                    <info>
                                        <title>MTA REST API</title>
                                        <description>This is the API of the Cloud Foundry MultiApps Controller
                                        </description>
                                        <version>1.4.0</version>
                                    </info>
                                </apiSource>
                            </apiSources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>api-doc-v2</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <apiSources>
                                <apiSource>
                                    <locations>org.cloudfoundry.multiapps.controller.api.v2</locations>
                                    <swaggerFileName>mtarest_v2</swaggerFileName>
                                    <info>
                                        <title>MTA REST API</title>
                                        <description>This is the API v2 of the Cloud Foundry MultiApps Controller
                                        </description>
                                        <version>2.0.0</version>
                                    </info>
                                </apiSource>
                            </apiSources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
