<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015-2020 OpenCB
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.opencb.opencga</groupId>
        <artifactId>opencga</artifactId>
        <version>3.4.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>opencga-analysis</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-storage-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-catalog</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.commons</groupId>
            <artifactId>commons-datastore-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-catalog</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-storage-core</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-storage-hadoop-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-storage-hadoop-core</artifactId>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-storage-hadoop-compat-${opencga-storage-hadoop-compat.id}</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga.hadoop.thirdparty</groupId>
            <artifactId>${opencga-hadoop-shaded.artifactId}</artifactId>
            <version>${opencga.hadoop.thirdparty.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga.hadoop.thirdparty</groupId>
            <artifactId>${opencga-hadoop-shaded.artifactId}</artifactId>
            <version>${opencga.hadoop.thirdparty.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.opencga</groupId>
            <artifactId>opencga-clinical</artifactId>
            <version>${project.parent.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.opencb.commons</groupId>
            <artifactId>commons-lib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.commons</groupId>
            <artifactId>commons-datastore-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.commons</groupId>
            <artifactId>commons-datastore-solr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.biodata</groupId>
            <artifactId>biodata-formats</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.biodata</groupId>
            <artifactId>biodata-models</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.biodata</groupId>
            <artifactId>biodata-tools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.cellbase</groupId>
            <artifactId>cellbase-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.cellbase</groupId>
            <artifactId>cellbase-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.oskar</groupId>
            <artifactId>oskar-analysis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opencb.ga4gh</groupId>
            <artifactId>ga4gh</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>arg.apache.avro</groupId>
                    <artifactId>avro-ipc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Added dependencies -->
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.samtools</groupId>
            <artifactId>htsjdk</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-test-framework</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <!-- Need dependency for running hadoop tests. -->
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!--
         Special jetty dependencies for storage-hadoop tests to work.
         This can't be moved to the main pom, as it would affect all the modules, and the final build would be incorrect.
    -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-webapp</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlet</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-http</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty.http2</groupId>
                <artifactId>http2-hpack</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-io</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-util</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-util-ajax</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-xml</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-rewrite</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-security</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-client</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-project</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-alpn-client</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-alpn-java-client</artifactId>
                <version>${jetty-for-hadoop-test.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <testResources>
            <testResource>
                <directory>../opencga-core/src/test/resources</directory>
                <includes>
                    <include>log4j2-test.xml</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <!-- This plugin is having a weird issue with biodata libraries. It fails if biodata is declared before. -->
                            <ignoredUsedUndeclaredDependencies>
                                <ignoredUsedUndeclaredDependency>
                                    com.google.code.findbugs:jsr305
                                </ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>
                                    org.opencb.opencga.hadoop.thirdparty:*
                                </ignoredUsedUndeclaredDependency>
                            </ignoredUsedUndeclaredDependencies>
                            <ignoredNonTestScopedDependencies>
                                <ignoredNonTestScopedDependency>
                                    org.opencb.commons:commons-datastore-mongodb
                                </ignoredNonTestScopedDependency>
                            </ignoredNonTestScopedDependencies>
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>*</ignoredUnusedDeclaredDependency>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>