<?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>
        <groupId>com.github.database-rider</groupId>
        <artifactId>rider-parent</artifactId>
        <version>1.2.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>rider-core</artifactId>
    <properties>
        <!-- must be overriden when releasing a new version with release profile -->
        <docs.outputdir>docs/latest</docs.outputdir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.dbunit</groupId>
            <artifactId>dbunit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-lgpl</artifactId>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.5.2</version>
            <scope>provided</scope>
        </dependency>

        <!-- bdd tests -->
        <!--tag::cucumber-deps[]-->
        <dependency> <!--1-->
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.4</version>
            <scope>test</scope>
        </dependency>
        <dependency> <!--1-->
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.4</version>
            <scope>test</scope>
        </dependency>
        <!--end::cucumber-deps[]-->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.6</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <parallel>classes</parallel>
                    <useUnlimitedThreads>true</useUnlimitedThreads>
                    <reuseForks>false</reuseForks>
                    <includes>
                        <include>**/*It.java</include>
                        <include>**/*Test.java</include>
                        <include>**/*Bdd.java</include>
                    </includes>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>
                            src/test/resources/logging.properties
                        </java.util.logging.config.file>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>docs</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.cukedoctor</groupId>
                        <artifactId>cukedoctor-maven-plugin</artifactId>
                        <version>1.0.6</version>
                        <configuration>
                            <outputFileName>documentation</outputFileName>
                            <!-- by default it resolves to 'latest' and is overriden by release profile -->
                            <outputDir>${docs.outputdir}</outputDir>
                            <!--pdf and html5 -->
                            <format>all</format>
                            <documentTitle>Database Rider Documentation</documentTitle>
                            <hideSummarySection>true</hideSummarySection>
                            <hideScenarioKeyword>true</hideScenarioKeyword>
                            <hideStepTime>true</hideStepTime>
                            <hideFeaturesSection>true</hideFeaturesSection>
                            <hideTags>true</hideTags>
                            <sourceHighlighter>coderay</sourceHighlighter>
                            <toc>center</toc>
                            <numbered>true</numbered>
                            <docVersion>${project.version}</docVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-publish-plugin</artifactId>
                        <version>1.1</version>
                        <configuration>
                            <checkoutDirectory>${project.build.outputDirectory}</checkoutDirectory>
                            <checkinComment>Publishing Database Rider ${project.parent.version} living documentation.
                            </checkinComment>
                            <content>target/docs</content>
                            <skipDeletedFiles>true</skipDeletedFiles>
                            <pubScmUrl>scm:git:https://${USER}:${PASS}@github.com/database-rider/database-rider.git
                            </pubScmUrl>
                            <scmBranch>gh-pages</scmBranch>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <docs.outputdir>docs/${project.version}</docs.outputdir>
            </properties>
        </profile>
    </profiles>

</project>
