<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2017-2019, Schlumberger

  Licensed 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>
    <artifactId>notification-gc</artifactId>
    <version>0.25.0-SNAPSHOT</version>
    <name>notification-gc</name>
    <description>Google Cloud implementation for Notification service</description>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.opengroup.osdu</groupId>
        <artifactId>os-notification</artifactId>
        <version>0.25.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <properties>
        <java.version>17</java.version>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>2.15.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.opengroup.osdu</groupId>
            <artifactId>core-lib-gc</artifactId>
            <version>0.23.1</version>
        </dependency>

        <dependency>
            <groupId>org.opengroup.osdu</groupId>
            <artifactId>notification-core</artifactId>
            <version>0.25.0-SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.apis</groupId>
                    <artifactId>google-api-services-iam</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.oauth-client</groupId>
                    <artifactId>google-oauth-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback.contrib</groupId>
            <artifactId>logback-json-classic</artifactId>
            <version>0.1.5</version>
        </dependency>

        <!-- unit test dependencies -->
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>2.0.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>2.0.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.12.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opengroup.osdu</groupId>
            <artifactId>oqm</artifactId>
            <version>0.23.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot-maven-plugin.version}</version>
                <configuration>
                    <profiles>
                        <profile>
                            <id>local</id>
                            <activation>
                                <activeByDefault>true</activeByDefault>
                            </activation>
                            <properties>
                                <spring.profiles.active>local</spring.profiles.active>
                            </properties>
                        </profile>
                        <profile>
                            <id>dev</id>
                            <properties>
                                <spring.profiles.active>dev</spring.profiles.active>
                            </properties>
                        </profile>
                    </profiles>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <classifier>spring-boot</classifier>
                            <mainClass>
                                org.opengroup.osdu.notification.provider.gcp.Application
                            </mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.10</version>
				<executions>
					<execution>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>report</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
         	<plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version>3.0.0</version>
                 <configuration>
                     <argLine>
                         @{argLine} --add-opens java.base/java.util=ALL-UNNAMED
                         --add-opens java.base/java.lang=ALL-UNNAMED
                     </argLine>
                 </configuration>
             </plugin>
        </plugins>
    </build>
</project>