<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~  Copyright (c) 2021, WSO2 Inc. (http://wso2.com) 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>
        <artifactId>apimgt</artifactId>
        <groupId>org.wso2.am.choreo.extensions</groupId>
        <version>1.0.40</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.am.choreo.extensions.quota.limiter.api</artifactId>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.apimgt</groupId>
            <artifactId>org.wso2.carbon.apimgt.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.apimgt</groupId>
            <artifactId>org.wso2.carbon.apimgt.rest.api.publisher.v1.common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.apimgt</groupId>
            <artifactId>org.wso2.carbon.apimgt.rest.api.common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${com.google.protobuf.version}</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty-shaded</artifactId>
            <version>${grpc-netty-shaded.version}</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>${io.grpc.version}</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>${grpc-stub.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-testing</artifactId>
            <version>${io.grpc.testing.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${org.mockito.core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.am.choreo.extensions</groupId>
            <artifactId>org.wso2.am.choreo.extensions.core</artifactId>
            <scope>provided</scope>
            <version>${parent.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <complianceLevel>1.8</complianceLevel>
                    <excludes>
                        <exclude>**/mappers/*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <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>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Private-Package>
                            org.wso2.am.choreo.extensions.quota.limiter.api.internal,
                            io.grpc.*,
                            io.envoyproxy.*,
                            com.google.protobuf.*,
                            com.google.common.util.concurrent.*,
                            io.perfmark.*,
                            javax.annotation.*
                        </Private-Package>
                        <Export-Package>
                            org.wso2.am.choreo.extensions.quota.limiter.api.*; version="${project.version}"
                        </Export-Package>
                        <Import-Package>
                            org.apache.commons.logging.*; version="${import.package.version.commons.logging}",
                            org.wso2.carbon.apimgt.api.*; version="${carbon.apimgt.imp.pkg.version}",
                            org.wso2.carbon.apimgt.rest.api.publisher.v1.common.*;
                            version="${carbon.apimgt.imp.pkg.version}",
                            org.wso2.carbon.apimgt.rest.api.common.*; version="${carbon.apimgt.imp.pkg.version}",
                            org.wso2.am.choreo.extensions.core.*
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
            <!--             This plugin compiles proto file into java files. -->
            <!--            <plugin>-->
            <!--                <groupId>com.github.os72</groupId>-->
            <!--                <artifactId>protoc-jar-maven-plugin</artifactId>-->
            <!--                <version>3.6.0.1</version>-->
            <!--                <executions>-->
            <!--                    <execution>-->
            <!--                        <phase>generate-sources</phase>-->
            <!--                        <goals>-->
            <!--                            <goal>run</goal>-->
            <!--                        </goals>-->
            <!--                        <configuration>-->
            <!--                            <includeMavenTypes>direct</includeMavenTypes>-->

            <!--                            <inputDirectories>-->
            <!--                                <include>src/main/proto</include>-->
            <!--                            </inputDirectories>-->

            <!--                            <outputTargets>-->
            <!--                                <outputTarget>-->
            <!--                                    <type>java</type>-->
            <!--                                    <outputDirectory>src/main/java/org/wso2/am/choreo/extensions/quota.limiter.api</outputDirectory>-->
            <!--                                </outputTarget>-->
            <!--                                <outputTarget>-->
            <!--                                    <type>grpc-java</type>-->
            <!--                                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.15.0</pluginArtifact>-->
            <!--                                    <outputDirectory>src/main/java</outputDirectory>-->
            <!--                                </outputTarget>-->
            <!--                            </outputTargets>-->
            <!--                        </configuration>-->
            <!--                    </execution>-->
            <!--                </executions>-->
            <!--            </plugin>-->

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

</project>
