<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~ Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
 ~
 ~ WSO2 LLC. 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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>open-banking-accelerator</artifactId>
        <groupId>com.wso2.openbanking.accelerator</groupId>
        <version>3.2.30-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <artifactId>com.wso2.openbanking.accelerator.ciba</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Open Banking - Common component</name>
    <dependencies>
        <dependency>
            <groupId>com.wso2.openbanking.accelerator</groupId>
            <artifactId>com.wso2.openbanking.accelerator.common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.wso2.openbanking.accelerator</groupId>
            <artifactId>com.wso2.openbanking.accelerator.identity</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
            <artifactId>org.wso2.carbon.identity.oauth</artifactId>
            <version>${identity.inbound.auth.oauth.ciba.updated.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
            <artifactId>org.wso2.carbon.identity.oauth.ciba</artifactId>
            <version>${identity.inbound.auth.oauth.ciba.updated.version}</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-testng</artifactId>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
        </dependency>
        <dependency>
            <groupId>com.wso2.openbanking.accelerator</groupId>
            <artifactId>com.wso2.openbanking.accelerator.consent.service</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <!--Excluding them in coverage reports-->
                        <exclude>**/*GrantHandler.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-prepare-agent-integration</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report-integration</id>
                        <goals>
                            <goal>report-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.86</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <xmlOutput>true</xmlOutput>
                    <failOnError>false</failOnError>
                    <spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
                    <excludeFilterFile>${project.basedir}/src/main/resources/findbugs-exclude.xml</excludeFilterFile>
                    <includeFilterFile>${project.basedir}/src/main/resources/findbugs-include.xml</includeFilterFile>
                    <failOnError>false</failOnError>
                    <plugins>
                        <plugin>
                            <groupId>com.h3xstream.findsecbugs</groupId>
                            <artifactId>findsecbugs-plugin</artifactId>
                            <version>${com.h3xstream.findsecbugs.version}</version>
                        </plugin>
                    </plugins>
                </configuration>
                <executions>
                    <execution>
                        <id>analyze-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</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>
                        <Private-Package>
                            com.wso2.openbanking.accelerator.identity.internal
                        </Private-Package>
                        <Import-Package>
                            com.nimbusds.jwt; version="${nimbusds.osgi.version.range}",
                            com.wso2.openbanking.accelerator.common.exception; version="${project.version}",
                            com.wso2.openbanking.accelerator.common.util; version="${project.version}",
                            com.wso2.openbanking.accelerator.consent.mgt.service.impl; version="${project.version}",
                            net.minidev.json; version="${json-smart}",
                            org.apache.commons.logging; version="${commons.logging.version}",
                            org.wso2.carbon.identity.oauth.ciba.grant; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.oauth2; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.oauth2.dto; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.oauth2.model; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.oauth2.token; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.openidconnect; version="${identity.inbound.auth.oauth.version.range}",
                            org.wso2.carbon.identity.openidconnect.model; version="${identity.inbound.auth.oauth.version.range}",
                        </Import-Package>
                        <Export-Package>
                            !com.wso2.openbanking.accelerator.identity.internal,
                            com.wso2.openbanking.accelerator.ciba
                        </Export-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <_dsannotations>*</_dsannotations>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <properties>
        <identity.inbound.auth.oauth.ciba.updated.version>6.4.111.52</identity.inbound.auth.oauth.ciba.updated.version>
    </properties>
</project>
