<?xml version="1.0"?>
<!--

    ============LICENSE_START=======================================================
    org.onap.aai
    ================================================================================
    Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
    Copyright © 2017-2018 European Software Marketing Ltd.
    ================================================================================
    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.
    ============LICENSE_END=========================================================

-->
<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>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>1.2.1</version>
    </parent>

    <groupId>org.onap.aai.event-client</groupId>
    <artifactId>event-client</artifactId>
    <version>1.4.1-SNAPSHOT</version>
    <name>aai-event-client</name>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <sitePath>/content/sites/site/org/onap/aai/${project.artifactId}/${project.version}</sitePath>
        <!-- Minimum code coverage percentage. Please update this figure as coverage increases to prevent any drops in
         coverage caused by new changes. Note that this figure cannot be lower than the ONAP requirement of 0.55 -->
        <jacoco.line.coverage.limit>0.90</jacoco.line.coverage.limit>
        <jacoco.report.directory>${project.build.directory}/coverage-reports</jacoco.report.directory>
    </properties>

    <modules>
        <module>event-client-api</module>
        <module>event-client-dmaap</module>
        <module>event-client-kafka</module>
        <module>event-client-rabbitmq</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.2</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>1.8.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.6</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>License.txt</header>
                    <includes>
                        <include>src/main/java/**</include>
                        <include>src/test/java/**</include>
                        <include>pom.xml</include>
                    </includes>
                    <skipExistingHeaders>true</skipExistingHeaders>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <!-- Set goal to "format" to auto update license headers -->
                            <goal>check</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <nexusUrl>${onap.nexus.url}</nexusUrl>
                    <stagingProfileId>176c31dfe190a</stagingProfileId>
                    <serverId>ecomp-staging</serverId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.2</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <configuration>
                    <dumpOnExit>true</dumpOnExit>
                </configuration>
                <executions>
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${jacoco.report.directory}/jacoco.exec</destFile>
                            <propertyName>surefireArgLine</propertyName>
                            <!-- <append>true</append> -->
                        </configuration>
                    </execution>
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${jacoco.report.directory}/jacoco.exec</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${jacoco.report.directory}/jacoco</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <dataFile>${jacoco.report.directory}/jacoco.exec</dataFile>
                            <rules>
                                <!--  implementation is needed only for Maven 2  -->
                                <rule
                                    implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit
                                            implementation="org.jacoco.report.check.Limit">
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.line.coverage.limit}</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <site>
            <id>ecomp-javadoc</id>
            <url>dav:${onap.nexus.url}${sitePath}</url>
        </site>
    </distributionManagement>

</project>