<?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>
        <groupId>com.wso2.openbanking.accelerator</groupId>
        <artifactId>open-banking-react-apps</artifactId>
        <version>3.2.30-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>consent-approval-ui</artifactId>
    <packaging>war</packaging>
    <name>WSO2 Open Banking - Consent Approval Webapp</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <build.war.name>consentapproval</build.war.name>
        <build.bff.root.path>../../bfsi-bff</build.bff.root.path>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.wso2.openbanking.accelerator</groupId>
            <artifactId>com.wso2.openbanking.accelerator.identity</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.wso2.openbanking.accelerator</groupId>
            <artifactId>com.wso2.openbanking.accelerator.common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json.wso2</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <!-- For unit test-->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-testng</artifactId>
            <scope>test</scope>
        </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>
    </dependencies>

    <build>
        <finalName>${build.war.name}</finalName>
        <sourceDirectory>${build.bff.root.path}/src/main/java</sourceDirectory>
        <testSourceDirectory>${build.bff.root.path}/src/test/java</testSourceDirectory>
        <plugins>
            <!-- Standard plugin to generate WAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${maven-war-plugin.version}</version>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${basedir}/</directory>
                            <includes>
                                <include>.babelrc</include>
                                <include>loader.js</include>
                                <include>configs.js</include>
                                <include>package.json</include>
                                <include>pom.xml</include>
                                <include>README.md</include>
                                <include>webpack.config.js</include>
                                <include>frontend/**</include>
                                <include>site/**</include>
                                <include>lib/**</include>
                            </includes>
                            <targetPath>/</targetPath>
                        </resource>
                    </webResources>
                    <webXml>web.xml</webXml>
                    <warName>${build.war.name}</warName>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <workingDirectory>../../</workingDirectory>
                </configuration>
            </plugin>

        </plugins>
        <resources>
            <resource>
                <directory>../../bfsi-bff/src/main/resources</directory>
            </resource>
        </resources>
    </build>

</project>
