<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>no.ssb.vtl</groupId>
    <artifactId>java-vtl-parent</artifactId>
    <packaging>pom</packaging>
    <version>0.1.0</version>

    <modules>
        <module>java-vtl-model</module>
        <module>java-vtl-parser</module>
        <module>java-vtl-script</module>
        <module>java-vtl-interpreter</module>
        <module>java-vtl-connector</module>
        <module>java-vtl-ssb-api-connector</module>
        <module>java-vtl-test</module>
        <module>java-vtl-tools</module>
    </modules>

    <name>Java VTL</name>

    <description>Open Source Java implementation of the Validation Transformation Language.</description>
    <url>https://github.com/statisticsnorway/java-vtl-connectors</url>

    <inceptionYear>2016</inceptionYear>
    <organization>
        <name>Statistics Norway and contributors</name>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <oss.skipsign>true</oss.skipsign>
        <java.version>1.8</java.version>
    </properties>

    <developers>
        <developer>
            <name>Hadrien Kohl</name>
            <email>hadrien.kohl@gmail.com</email>
        </developer>
        <developer>
            <name>Eivind Høiseth-Gilje</name>
            <email>egi@capraconsulting.no</email>
        </developer>
        <developer>
            <name>Pawel Buczek</name>
        </developer>
    </developers>

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

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


    <scm>
        <connection>scm:git:git@github.com:statisticsnorway/java-vtl-connectors</connection>
        <developerConnection>scm:git:git@github.com:statisticsnorway/java-vtl-connectors</developerConnection>
        <url>https://github.com/statisticsnorway/java-vtl-connectors</url>
    </scm>


    <profiles>
        <profile>
            <id>travis</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>env.TRAVIS</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.8</version>
                        <executions>
                            <execution>
                                <id>jacoco-initialize</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>post-unit-test</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>com.gavinmogan</groupId>
                        <artifactId>codacy-maven-plugin</artifactId>
                        <version>1.0.3</version>
                        <configuration>
                            <commit>${env.TRAVIS_COMMIT}</commit>
                            <projectToken>01c6bf9024ea4792b80ad19921fc68d3</projectToken>
                            <coverageReportFile>target/site/jacoco/jacoco.xml</coverageReportFile>
                            <failOnMissingReportFile>false</failOnMissingReportFile>
                            <!-- <apiToken>NEEDED</apiToken> -->
                        </configuration>
                        <executions>
                            <execution>
                                <id>post-unit-test</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>coverage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/statisticsnorway/java-vtl/</url>
    </issueManagement>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/hadrienk/java-vtl</url>
    </ciManagement>

    <build>

        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.13</version>
                <configuration>
                    <licenseName>apache_v2</licenseName>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <processStartTag>========================LICENSE_START=================================
                    </processStartTag>
                    <processEndTag>=========================LICENSE_END==================================
                    </processEndTag>
                    <excludes>
                        <exclude>**/*.json</exclude>
                        <exclude>java-vtl-tools/src/main/resources/public/js/*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check-file-header</goal>
                            <!-- <goal>update-file-header</goal> -->
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <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>2.10.4</version>

                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </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>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>

                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <skip>${oss.skipsign}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.6.0</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>1.9</version>
                    <configuration>
                        <verbose>true</verbose>
                        <addSvnKeyWords>false</addSvnKeyWords>
                        <organizationName>Hadrien Kohl</organizationName>
                        <inceptionYear>2016</inceptionYear>
                        <licenseName>apache_v2</licenseName>
                        <projectName>Java VTL</projectName>
                        <extraExtensions>
                            <g4>java</g4>
                        </extraExtensions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>first</id>
                            <goals>
                                <goal>update-file-header</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <roots>
                                    <root>src/main/java</root>
                                    <root>src/test</root>
                                </roots>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <dependencies>

        <!-- Google java library -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <!-- Collectors for Guava collection types -->
        <dependency>
            <groupId>me.yanaga</groupId>
            <artifactId>guava-stream</artifactId>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-guava</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.carrotsearch.randomizedtesting</groupId>
            <artifactId>randomizedtesting-runner</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>

            <!-- Depend on ourselves -->
            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-connector</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-model</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-parser</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-script</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-ssb-api-connector</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>websocket</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-runtime</artifactId>
                <version>4.6</version>
            </dependency>

            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4</artifactId>
                <version>4.6</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>21.0</version>
            </dependency>

            <dependency>
                <groupId>me.yanaga</groupId>
                <artifactId>guava-stream</artifactId>
                <version>1.0</version>
            </dependency>

            <!-- Test framework -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.carrotsearch.randomizedtesting</groupId>
                <artifactId>randomizedtesting-runner</artifactId>
                <version>2.5.0</version>
                <scope>test</scope>
            </dependency>

            <!-- Assertion framework -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.6.1</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-guava</artifactId>
                <!-- Use 2.x version if you rely on Java 7 / AssertJ Core 2.x -->
                <version>3.1.0</version>
                <scope>test</scope>
            </dependency>

            <!-- Mock library -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>1.10.19</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.carrotsearch.randomizedtesting</groupId>
                <artifactId>randomizedtesting-runner</artifactId>
                <version>2.5.0</version>
                <scope>test</scope>
            </dependency>

            <!-- Own assertions -->
            <dependency>
                <groupId>no.ssb.vtl</groupId>
                <artifactId>java-vtl-test</artifactId>
                <version>${project.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>
</project>
