<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>agrest-parent</artifactId>
        <groupId>io.agrest</groupId>
        <version>4.5</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.agrest.openapi</groupId>
    <artifactId>agrest-openapi-designfirst-test</artifactId>
    <name>agrest-openapi-designfirst-test: code generator tests</name>
    <description>Openapi Integration tests for generated resources</description>

    <dependencies>
        <!-- required runtime dependencies -->
        <dependency>
            <groupId>io.agrest</groupId>
            <artifactId>agrest-engine</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.agrest</groupId>
            <artifactId>agrest-cayenne</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- unit test deps -->
        <dependency>
            <groupId>io.bootique.jdbc</groupId>
            <artifactId>bootique-jdbc-junit5-derby</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.bootique.cayenne</groupId>
            <artifactId>bootique-cayenne42-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.bootique.jetty</groupId>
            <artifactId>bootique-jetty-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.agrest</groupId>
            <artifactId>agrest-engine</artifactId>
            <type>test-jar</type>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.agrest</groupId>
            <artifactId>agrest-cayenne</artifactId>
            <type>test-jar</type>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.bootique.jersey</groupId>
            <artifactId>bootique-jersey</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>${openapi-generator-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${swagger-spec}</inputSpec>
                            <generatorName>io.swagger.codegen.languages.AgServerCodegen</generatorName>
                            <output>${project.basedir}</output>
                            <apiPackage>${base-package}.swagger.api.v${schema-version}.service</apiPackage>
                            <modelPackage>${base-package}.cayenne.cayenne.main</modelPackage>
                            <invokerPackage>${base-package}</invokerPackage>
                            <generateModels>false</generateModels>
                            <skipOverwrite>false</skipOverwrite>
                            <configOptions>
                                <generateForTesting>true</generateForTesting>
                                <generateSpringApplication>false</generateSpringApplication>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>

                <dependencies>
                    <dependency>
                        <groupId>io.agrest.openapi</groupId>
                        <artifactId>agrest-openapi-designfirst</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <properties>
        <schema-version>1</schema-version>
        <base-package>io.agrest</base-package>
        <swagger-spec>${project.basedir}/src/test/resources/api.yaml</swagger-spec>
    </properties>


</project>
