<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>{{groupId}}</groupId>
    <artifactId>{{artifactId}}</artifactId>
    <packaging>jar</packaging>
    <name>{{artifactId}}</name>
    <version>{{artifactVersion}}</version>
{{#parentOverridden}}
    <parent>
        <groupId>{{{parentGroupId}}}</groupId>
        <artifactId>{{{parentArtifactId}}}</artifactId>
        <version>{{{parentVersion}}}</version>
    </parent>
{{/parentOverridden}}
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty-version}</version>
                <configuration>
                    <webAppConfig>
                        <contextPath>{{^contextPath}}/{{/contextPath}}{{#contextPath}}{{contextPath}}{{/contextPath}}</contextPath>
                    </webAppConfig>
                    <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
                    <stopPort>8079</stopPort>
                    <stopKey>stopit</stopKey>
                    <stopWait>10</stopWait>
                    <httpConnector>
                        <port>{{serverPort}}</port>
                        <idleTimeout>60000</idleTimeout>
                    </httpConnector>
                </configuration>
{{#useBeanValidation}}
                <dependencies>
                    <dependency>
                        <groupId>javax.validation</groupId>
                        <artifactId>validation-api</artifactId>
                        <version>${beanvalidation-version}</version>
                    </dependency>
                </dependencies>
{{/useBeanValidation}}
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <scanIntervalSeconds>0</scanIntervalSeconds>
                            <daemon>true</daemon>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            {{#apiFirst}}
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>{{{generatorVersion}}}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>src/main/resources/openapi.yaml</inputSpec>
                            <generatorName>spring</generatorName>
                            <library>spring-mvc</library>
                            <apiPackage>{{{apiPackage}}}</apiPackage>
                            <modelPackage>{{{modelPackage}}}</modelPackage>
                            <generateSupportingFiles>false</generateSupportingFiles>
                            {{#modelNamePrefix}}
                            <modelNamePrefix>{{{.}}}</modelNamePrefix>
                            {{/modelNamePrefix}}
                            {{#modelNameSuffix}}
                            <modelNameSuffix>{{{.}}}</modelNameSuffix>
                            {{/modelNameSuffix}}
                            <configOptions>
                            {{#configOptions}}
                                <{{left}}>{{right}}</{{left}}>
                            {{/configOptions}}
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            {{/apiFirst}}
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j-version}</version>
        </dependency>

        <!--Spring dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring-version}</version>
        </dependency>
        {{#useSpringfox}}
        <!--SpringFox dependencies-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox-version}</version>
        </dependency>
        {{/useSpringfox}}
        {{^useSpringfox}}
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>swagger-ui</artifactId>
            <version>3.14.2</version>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>1.5.14</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        {{/useSpringfox}}
        {{#withXml}}
        <!-- XML processing: Jackson -->
        <dependency>
          <groupId>com.fasterxml.jackson.dataformat</groupId>
          <artifactId>jackson-dataformat-xml</artifactId>
          <version>${jackson-version}</version>
        </dependency>
        {{/withXml}}
        {{#java8}}
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        {{/java8}}
        {{#joda}}
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        {{/joda}}
        {{#threetenbp}}
        <dependency>
            <groupId>com.github.joschi.jackson</groupId>
            <artifactId>jackson-datatype-threetenbp</artifactId>
            <version>${jackson-threetenbp-version}</version>
        </dependency>
        {{/threetenbp}}
        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>jackson-databind-nullable</artifactId>
            <version>0.1.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${servlet-api-version}</version>
        </dependency>
{{#useBeanValidation}}
        <!-- Bean Validation API support -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>${beanvalidation-version}</version>
            <scope>provided</scope>
        </dependency>
{{/useBeanValidation}}
{{#hateoas}}
        <!-- Spring HATEOAS -->
        <dependency>
            <groupId>org.springframework.hateoas</groupId>
            <artifactId>spring-hateoas</artifactId>
            <version>0.25.0.RELEASE</version>
        </dependency>
{{/hateoas}}
    </dependencies>
    <properties>
        <java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <jetty-version>9.2.15.v20160210</jetty-version>
        <slf4j-version>1.7.21</slf4j-version>
        <junit-version>4.12</junit-version>
        <servlet-api-version>2.5</servlet-api-version>
        <springfox-version>2.8.0</springfox-version>
        <jackson-version>2.9.5</jackson-version>
        <jackson-threetenbp-version>2.8.4</jackson-threetenbp-version>
{{#useBeanValidation}}
        <beanvalidation-version>1.1.0.Final</beanvalidation-version>
{{/useBeanValidation}}
        <spring-version>4.3.20.RELEASE</spring-version>
    </properties>
</project>
