<?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/maven-v4_0_0.xsd">

    <artifactId>opflow-core</artifactId>
    <groupId>com.devebot.opflow</groupId>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <version>0.1.28</version>
    <name>opflow-core</name>
    <description>Devebot Opflow for Java</description>
    <url>https://github.com/opflow/opflow-java</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Devebot Team</name>
            <email>contact@devebot.com</email>
            <organization>Devebot</organization>
            <organizationUrl>https://www.devebot.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/opflow/opflow-java.git</connection>
        <developerConnection>scm:git:ssh://github.com:opflow/opflow-java.git</developerConnection>
        <url>https://github.com/opflow/opflow-java/tree/master</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <artifact.name>${project.artifactId}</artifact.name>
        <java.version>1.7</java.version>
        <amqp-client.version>5.7.3</amqp-client.version>
        <gson.version>2.8.6</gson.version>
        <joda-time.version>2.10.5</joda-time.version>
        <prometheus.version>0.8.0</prometheus.version>
        <snakeyaml.version>1.18</snakeyaml.version>
        <slf4j.version>1.7.21</slf4j.version>
        <undertow.version>2.0.27.Final</undertow.version>
        <junit.version>4.12</junit.version>
        <mockito-core.version>2.28.2</mockito-core.version>
        <powermock.version>2.0.4</powermock.version>
    </properties>

    <repositories>
        <repository>
            <id>repo1</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>repo1</id>
            <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>com.rabbitmq</groupId>
            <artifactId>amqp-client</artifactId>
            <version>${amqp-client.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-core</artifactId>
            <version>${undertow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_hotspot</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_httpserver</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.11</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>1.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jbehave</groupId>
            <artifactId>jbehave-core</artifactId>
            <version>4.6.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.21</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${artifact.name}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>false</skipTests>
                    <runOrder>alphabetical</runOrder>
                    <argLine>--add-opens java.xml/jdk.xml.internal=ALL-UNNAMED</argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit4</artifactId>
                        <version>2.22.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>bdd</id>
            <activation>
                <property>
                    <name>!profile.bdd.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.22.2</version>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>**/*Stories.java</include>
                            </includes>
                            <systemProperties>
                                <property>
                                    <name>opflow.mode</name>
                                    <value>test</value>
                                </property>
                            </systemProperties>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jbehave</groupId>
                        <artifactId>jbehave-maven-plugin</artifactId>
                        <version>4.6.1</version>
                        <executions>
                            <execution>
                                <id>run-stories-as-embeddables</id>
                                <phase>integration-test</phase>
                                <configuration>
                                    <includes>
                                        <include>**/*Stories.java</include>
                                    </includes>
                                    <metaFilters>
                                        <metaFilter>+author *</metaFilter>
                                        <metaFilter>-skip</metaFilter>
                                    </metaFilters>
                                    <systemProperties>
                                        <property>
                                            <name>java.awt.headless</name>
                                            <value>true</value>
                                        </property>
                                    </systemProperties>
                                    <ignoreFailureInStories>false</ignoreFailureInStories>
                                    <ignoreFailureInView>false</ignoreFailureInView>
                                    <generateViewAfterStories>false</generateViewAfterStories>
                                </configuration>
                                <goals>
                                    <goal>run-stories-as-embeddables</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>dep</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>dep</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                    <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>
                        <version>3.1.1</version>
                        <configuration>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>git</id>
            <activation>
                <property>
                    <name>!profile.git.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>
                        <version>4.0.0</version>
                        <executions>
                            <execution>
                                <id>get-the-git-infos</id>
                                <goals>
                                    <goal>revision</goal>
                                </goals>
                                <phase>initialize</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <dotGitDirectory>${dot.git.directory}</dotGitDirectory>
                            <prefix>git</prefix>
                            <verbose>false</verbose>
                            <dateFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</dateFormat>
                            <generateGitPropertiesFile>true</generateGitPropertiesFile>
                            <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/com.devebot.opflow/opflow-core/git-info.json</generateGitPropertiesFilename>
                            <includeOnlyProperties>
                                <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                                <includeOnlyProperty>^git.commit.id$</includeOnlyProperty>
                                <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
                            </includeOnlyProperties>
                            <excludeProperties>
                                <excludeProperty>^git.remote.origin.url$</excludeProperty>
                                <excludeProperty>^git.tags$</excludeProperty>
                            </excludeProperties>
                            <format>json</format>
                            <gitDescribe>
                                <skip>false</skip>
                                <always>false</always>
                                <dirty>-dirty</dirty>
                            </gitDescribe>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
    <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>
</project>

