<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.4.RELEASE</version>
    </parent>

    <artifactId>openexchange-boot</artifactId>
    <groupId>io.openexchange</groupId>
    <version>1.0.4</version>
    <packaging>pom</packaging>

    <name>openexchange ::: ${project.artifactId}</name>
    <description>The bootstrap and dependencies bundle for all `io.openexchange` projects.</description>
    <url>http://openexchange.io</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Andriy Kandzyuba</name>
            <email>andrey.kandzuba@gmail.com</email>
            <organization>Ideas Open Exchange</organization>
            <organizationUrl>http://openexchange.io</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>
            https://github.com/andrewkandzuba/${project.artifactId}.git
        </connection>
        <developerConnection>
            scm:git:[fetch=]https://github.com/andrewkandzuba/${project.artifactId}.git[push=]git@github.com:andrewkandzuba/${project.artifactId}.git
        </developerConnection>
      <tag>v1.0.4</tag>
  </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- dependencies -->
        <spring-cloud-dependencies.version>Camden.SR4</spring-cloud-dependencies.version>
        <commons-lang3.version>3.5</commons-lang3.version>
        <jettison.version>1.3.8</jettison.version>

        <!-- plugins -->
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-scm-plugin.version>1.9.5</maven-scm-plugin.version>
        <jsonschema2pojo-maven-plugin.version>0.4.28</jsonschema2pojo-maven-plugin.version>
        <maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <fabric8.docker-maven-plugin.version>0.18.1</fabric8.docker-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jettison</groupId>
                <artifactId>jettison</artifactId>
                <version>${jettison.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>openexchange-boot-batch</module>
        <module>openexchange-boot-starter-parent</module>
        <module>openexchange-boot-metrics</module>
    </modules>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>parse-version</id>
                            <goals>
                                <goal>parse-version</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>add-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.build.directory}/generated-sources</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <configuration>
                        <delimiters>
                            <delimiter>@</delimiter>
                            <delimiter>${*}</delimiter>
                        </delimiters>
                        <useDefaultDelimiters>true</useDefaultDelimiters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jsonschema2pojo</groupId>
                    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                    <version>${jsonschema2pojo-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <includeJsr303Annotations>true</includeJsr303Annotations>
                        <sourceDirectory>${basedir}/src/main/resources/pojos</sourceDirectory>
                        <outputDirectory>${basedir}/target/generated-sources</outputDirectory>
                        <targetPackage>io.openexchange.pojos</targetPackage>
                        <useCommonsLang3>true</useCommonsLang3>
                        <serializable>true</serializable>
                        <generateBuilders>true</generateBuilders>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-api</artifactId>
                            <version>${maven-scm-plugin.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>${maven-scm-plugin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${fabric8.docker-maven-plugin.version}</version>
                    <configuration>
                        <verbose>true</verbose>
                        <images>
                            <image>
                                <alias>${project.artifactId}</alias>
                                <name>%g/${project.artifactId}:${project.version}</name>
                                <build>
                                    <tags>
                                        <tag>latest</tag>
                                        <tag>${project.version}</tag>
                                    </tags>
                                    <from>openjdk:8</from>
                                    <assembly>
                                        <inline>
                                            <dependencySets>
                                                <dependencySet>
                                                    <includes>
                                                        <include>${project.groupId}:${project.artifactId}:jar:${project.version}
                                                        </include>
                                                    </includes>
                                                    <outputFileNameMapping>${project.artifactId}.jar</outputFileNameMapping>
                                                </dependencySet>
                                            </dependencySets>
                                        </inline>
                                    </assembly>
                                    <entryPoint>
                                        <shell>java $JAVA_OPTS -Djava.security.egd=file:/dev/urandom -jar /maven/${project.artifactId}.jar</shell>
                                    </entryPoint>
                                </build>
                            </image>
                        </images>
                    </configuration>
                    <executions>
                        <execution>
                            <id>docker-build</id>
                            <phase>package</phase>
                            <goals>
                                <goal>build</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>docker-push</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>push</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-extras</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <source>1.9</source>
                                <target>1.9</target>
                                <fork>true</fork>
                                <meminitial>1024m</meminitial>
                                <maxmem>4096m</maxmem>
                                <compilerArgs>
                                    <arg>--add-modules</arg>
                                    <arg>java.xml.bind,java.annotations.common</arg>
                                </compilerArgs>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <argLine>--add-modules java.xml.bind,java.annotations.common</argLine>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-jar-plugin</artifactId>
                            <version>${maven-jar-plugin.version}</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>jdk8</id>
            <activation>
                <jdk>[1.6,9)</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <source>1.8</source>
                                <target>1.8</target>
                                <fork>true</fork>
                                <meminitial>1024m</meminitial>
                                <maxmem>4096m</maxmem>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>