<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ /*
  ~ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~ *
  ~ * 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">
    <parent>
        <artifactId>apimgt</artifactId>
        <groupId>org.wso2.carbon.apimgt</groupId>
        <version>7.0.246</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>org.wso2.carbon.apimgt.rest.api.analytics</artifactId>
    <name>Analytics Micro Service</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.wso2.msf4j</groupId>
            <artifactId>msf4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.datasources</groupId>
            <artifactId>org.wso2.carbon.datasource.core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.apimgt</groupId>
            <artifactId>org.wso2.carbon.apimgt.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.apimgt</groupId>
            <artifactId>org.wso2.carbon.apimgt.rest.api.commons</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <!--<plugin>
                <groupId>org.wso2.maven.plugins</groupId>
                <artifactId>swagger2msf4j-maven-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                <configuration>
                    <inputSpec>${project.basedir}/src/main/resources/analytics-api.yaml</inputSpec>
                    <autoEnableOptions>true</autoEnableOptions>
                </configuration>
            </plugin>-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/gen/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- Overridden from parent pom to exclude generated sources -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>
                                https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/checkstyle.xml
                            </configLocation>
                            <suppressionsLocation>
                                https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/suppressions.xml
                            </suppressionsLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <!--Exclude generated sources-->
                            <excludes>**/gen/**/*</excludes>
                            <!--skip for generated resources-->
                            <skip>true</skip>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- REST API documentation generation -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-common-doc-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-apidocs/docs</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.parent.parent.basedir}/components/apimgt/org.wso2.carbon.apimgt.rest.api.commons/src/main/resources/doc-templates</directory>
                                    <excludes>
                                        <exclude>**/*.mustache</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-generated-doc-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.parent.parent.basedir}/docs/apis/analytics/v1.0
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/generated-apidocs/docs</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
<!--
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>${swagger.codegen.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.parent.parent.basedir}/components/apimgt/org.wso2.carbon.apimgt.rest.api.analytics/src/main/resources/analytics-api.yaml</inputSpec>
                            <language>org.wso2.carbon.apimgt.rest.api.common.codegen.DynamicHtmlGen</language>
                            <templateDirectory>${project.parent.parent.basedir}/components/apimgt/org.wso2.carbon.apimgt.rest.api.commons/src/main/resources/doc-templates</templateDirectory>
                            <output>${project.build.directory}/generated-apidocs</output>
                        </configuration>
                    </execution>
                </executions>

                <dependencies>
                    <dependency>
                        <groupId>org.wso2.carbon.apimgt</groupId>
                        <artifactId>org.wso2.carbon.apimgt.rest.api.commons</artifactId>
                        <version>${carbon.apimgt.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.commonmark</groupId>
                        <artifactId>commonmark</artifactId>
                        <version>${atlassian.commonmark.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
-->
            <!-- End of REST API documentation generation -->

        </plugins>
    </build>

    <properties>
        <private.package>org.wso2.carbon.apimgt.rest.api.analytics.internal</private.package>
        <import.package>
            org.wso2.carbon.datasource.core.*; version="${datasources.core.package.import.version.range}",
            com.zaxxer.hikari.*; version="${hikari.package.import.version.range}",
            org.wso2.msf4j.*; version="${msf4j.package.import.version.range}",
            org.slf4j.*;version="${slf4j.logging.package.import.version.range}",
            org.wso2.carbon.apimgt.rest.api.common.*;version="${carbon.apimgt.version}",
            org.wso2.carbon.apimgt.core.*; version="${carbon.apimgt.import.pkg.version}",
            org.apache.commons.lang3.*; version="${apache.commons.lang3.import.version.range}",
            javax.ws.rs.*; version="${javax.ws.rs.import.version.range}",
            com.google.gson.*; version="${google.code.gson.import.version.range}"
        </import.package>
        <export.package>
            !org.wso2.carbon.apimgt.rest.api.analytics.internal,
            org.wso2.carbon.apimgt.rest.api.analytics.*; version="${carbon.apimgt.version}"
        </export.package>
        <carbon.component>
            osgi.service; objectClass="org.wso2.msf4j.Microservice"; serviceCount="3"
        </carbon.component>
    </properties>

</project>
