<?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>
        <artifactId>analytics-processors</artifactId>
        <groupId>org.wso2.carbon.analytics</groupId>
        <version>1.3.12</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.analytics.spark.core</artifactId>
    <description>This component is used for the core operations such as store, deploy, execute the script</description>
    <name>WSO2 Carbon - Analytics Spark Core</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.ndatasource.rdbms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.commons</groupId>
            <artifactId>org.wso2.carbon.ntask.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.application.deployer</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.10</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_2.10</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.dataservice.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.datasource.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.datasource.commons</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics-common</groupId>
            <artifactId>org.wso2.carbon.databridge.commons</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.datasource.rdbms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.spark.utils</artifactId>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics</groupId>
            <artifactId>org.wso2.carbon.analytics.datasource.core.test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spark-project.akka</groupId>
            <artifactId>akka-actor_2.10</artifactId>
        </dependency>
        <dependency>
            <groupId>com.esotericsoftware.kryo</groupId>
            <artifactId>kryo</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
                    <dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
                    <propertyName>jcoverage.command</propertyName>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <argLine>${jcoverage.command} -Xms256m -Xmx1024m -XX:MaxPermSize=256m</argLine>
                    <!--<debugForkedProcess>true</debugForkedProcess>-->
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.15.2</version>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <!--<execution>-->
                        <!--<goals>-->
                            <!--<goal>compile</goal>-->
                        <!--</goals>-->
                    <!--</execution>-->
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>
                            org.wso2.carbon.analytics.spark.core.*;version="${carbon.analytics.version}",
                            org.apache.spark.sql.jdbc.carbon.*;version="${carbon.analytics.version}"
                        </Export-Package>
                        <Import-Package>
			                com.google.common.*;version="${guava.import.version}",
                            org.apache.spark.*;version="${spark.sql.version.range}",
                            org.apache.spark.sql.*;version="${spark.sql.version.range}",
                            org.apache.spark.sql.types.*;version="${spark.sql.version.range}",
                            org.apache.spark.api.java.*;version="${spark.sql.version.range}",
                            com.esotericsoftware.kryo.*;version="${kryo.import.version}"
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Private-Package>
                            org.wso2.carbon.analytics.spark.core.internal.*,
                        </Private-Package>
                        <Include-Resource>
                            {maven-resources}
                        </Include-Resource>
                        <WSO2-Application-Deployer>Spark Script CApp Deployer</WSO2-Application-Deployer>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
