<?xml version="1.0" encoding="UTF-8"?>

<!--
 Copyright (c) 2014-2018 Red Hat, Inc. and/or its affiliates.

 This program and the accompanying materials are made
 available under the terms of the Eclipse Public License 2.0
 which is available at https://www.eclipse.org/legal/epl-2.0/

 SPDX-License-Identifier: EPL-2.0
-->

<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.jberet</groupId>
        <artifactId>jberet-parent</artifactId>
        <version>1.4.8.Final</version>
    </parent>

    <artifactId>jberet-support</artifactId>
    <version>1.4.2.Final</version>

    <properties>
        <modular.jdk.args/>
        <surefire.system.args>-Xms512m -Xmx2g ${modular.jdk.args}</surefire.system.args>

        <version.org.jberet>${project.parent.version}</version.org.jberet>
        <version.org.mongojack>2.8.2</version.org.mongojack>
        <version.org.apache.kafka>0.9.0.0</version.org.apache.kafka>
        <version.net.sf.jasperreports>6.17.0</version.net.sf.jasperreports>
        <version.org.apache.activemq.artemis>2.19.1</version.org.apache.activemq.artemis>

        <version.org.beanio>2.1.0</version.org.beanio>
        <version.org.ow2.asm>5.0.4</version.org.ow2.asm>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.mongojack</groupId>
                <artifactId>mongojack</artifactId>
                <version>${version.org.mongojack}</version>
                <scope>provided</scope>
                <exclusions>
                    <exclusion>
                        <groupId>javax.persistence</groupId>
                        <artifactId>persistence-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Kafka ItemReader & ItemWriter dependencies -->
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${version.org.apache.kafka}</version>
                <scope>provided</scope>
            </dependency>

            <!-- JasperReports dependencies -->
            <dependency>
                <groupId>net.sf.jasperreports</groupId>
                <artifactId>jasperreports</artifactId>
                <version>${version.net.sf.jasperreports}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Artemis ItemReader & ItemWriter dependencies -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>artemis-core-client</artifactId>
                <version>${version.org.apache.activemq.artemis}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>artemis-commons</artifactId>
                <version>${version.org.apache.activemq.artemis}</version>
                <scope>provided</scope>
            </dependency>

            <!-- JmsItemReader & JmsItemWriter test dependencies -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>artemis-server</artifactId>
                <version>${version.org.apache.activemq.artemis}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>artemis-jms-server</artifactId>
                <version>${version.org.apache.activemq.artemis}</version>
                <scope>test</scope>
            </dependency>

            <!-- BeanIO dependencies -->
            <dependency>
                <groupId>org.beanio</groupId>
                <artifactId>beanio</artifactId>
                <version>${version.org.beanio}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>${version.org.ow2.asm}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <dependencies>
        <dependency>
            <groupId>org.jboss.spec.javax.xml.bind</groupId>
            <artifactId>jboss-jaxb-api_2.2_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mongojack</groupId>
            <artifactId>mongojack</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>aalto-xml</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>stax2-api</artifactId>
        </dependency>

        <dependency>
            <groupId>net.sf.supercsv</groupId>
            <artifactId>super-csv</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-xml</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-csv</artifactId>
        </dependency>

        <!-- beanio dependencies -->
        <dependency>
            <groupId>org.beanio</groupId>
            <artifactId>beanio</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
        </dependency>

        <!-- Excel dependencies -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <!-- override the version from parent pom to work with poi 4.1.2 -->
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
        </dependency>

        <!-- JMS reader & writer dependencies -->
        <dependency>
            <groupId>org.jboss.spec.javax.jms</groupId>
            <artifactId>jboss-jms-api_2.0_spec</artifactId>
        </dependency>

        <!-- Kafka ItemReader & ItemWriter dependencies -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
        </dependency>

        <!-- Bean Validation dependencies -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.el</groupId>
            <artifactId>jboss-el-api_3.0_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
        </dependency>

        <!-- JasperReports dependencies -->
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
        </dependency>

        <!-- JAX-RS dependencies -->
        <dependency>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
        </dependency>

        <!-- Cassandra dependencies -->
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.jberet</groupId>
            <artifactId>jberet-core</artifactId>
            <version>${version.org.jberet}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jberet</groupId>
            <artifactId>jberet-se</artifactId>
            <version>${version.org.jberet}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.se</groupId>
            <artifactId>weld-se-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jandex</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.annotation</groupId>
            <artifactId>jboss-annotations-api_1.3_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.transaction</groupId>
            <artifactId>jboss-transaction-api_1.2_spec</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-server</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-jms-server</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>${version.com.fasterxml.jackson}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jdk7</artifactId>
            <version>2.5.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${version.org.hibernate}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${version.org.hibernate}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>${surefire.system.args}</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk17</id>
            <activation>
                <jdk>[17,)</jdk>
            </activation>
            <properties>
                <modular.jdk.args>
                    --add-exports=java.desktop/sun.awt=ALL-UNNAMED
                    --add-opens=java.base/java.io=ALL-UNNAMED
                    --add-opens=java.base/java.lang=ALL-UNNAMED
                    --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
                    --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
                    --add-opens=java.base/java.security=ALL-UNNAMED
                    --add-opens=java.base/java.util=ALL-UNNAMED
                    --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
                    --add-opens=java.management/javax.management=ALL-UNNAMED
                    --add-opens=java.naming/javax.naming=ALL-UNNAMED
                </modular.jdk.args>
            </properties>
        </profile>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/Mongo*.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>allTests</id>
            <activation>
                <property>
                    <name>allTests</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
