<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you 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">
    <parent>
        <groupId>org.wso2.am.analytics.publisher</groupId>
        <artifactId>apim-analytics-publisher-component</artifactId>
        <version>1.1.3</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.am.analytics.publisher.client</artifactId>
    <packaging>bundle</packaging>
    <name>APIM Analytics EventHub Client Implementation</name>
    <dependencies>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-messaging-eventhubs</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-gson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>ua.parser.wso2</groupId>
            <artifactId>ua-parser</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mock-server</groupId>
            <artifactId>mockserver-netty</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.wso2.am.analytics.publisher.reporter.cloud.*;version="${project.version}",
                            !org.wso2.am.analytics.publisher.reporter.choreo;version="${project.version}",
                            org.wso2.am.analytics.publisher.client.*;version="${project.version}",
                            org.wso2.am.analytics.publisher.reporter.*;version="${project.version}",
                            org.wso2.am.analytics.publisher.exception.*;version="${project.version}",
                            org.wso2.am.analytics.publisher.auth.*;version="${project.version}",
                            org.wso2.am.analytics.publisher.util.*;version="${project.version}",
                        </Export-Package>
                        <Private-Package>
                        </Private-Package>
                        <Import-Package>
                            com.google.gson.*;version="${gson.import.version.range}",
                            com.google.gson.annotations.*;version="${google.gson.import.version.range}",
                            com.azure.core.credential.*;version="${azure.core.import.version.range}",
                            com.azure.messaging.eventhubs.*;version="${azure.messaging.import.version.range}",
                            feign.*;version="${feign.import.version.range}",
                            feign.codec.*;version="${feign.import.version.range}",
                            feign.gson.*;version="${feign.import.version.range}",
                            feign.slf4j.*;version="${feign.import.version.range}",
                            org.apache.logging.log4j.*;version="${apache.log4j.import.version.range}",
                            ua_parser.*;version="${ua_parser.import.version.range}",
                            com.microsoft.azure.proton.transport.*;version="${azure-qpid-proton-j-extensions.import.version.range}",
                            org.apache.http.*,
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Include-Resource>
                            META-INF=target/classes/META-INF,
                            {maven-resources}
                        </Include-Resource>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>

                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>org.wso2.am.analytics.publisher.client.EventHubPublisherRunner</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>