<!--
============LICENSE_START=======================================================
org.onap.aai
================================================================================
Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
Copyright © 2017-2018 Amdocs
================================================================================
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.aai</groupId>
        <artifactId>champ</artifactId>
        <version>1.2.3-SNAPSHOT</version>
    </parent>

    <groupId>org.onap.aai.champ</groupId>
    <artifactId>champ-lib</artifactId>
    <packaging>pom</packaging>

    <modules>
        <module>champ-core</module>
        <module>champ-titan</module>
        <module>champ-janus</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!--<absoluteDistFilesRoot>/appl/${project.artifactId}</absoluteDistFilesRoot>-->

        <!--&lt;!&ndash; For NO Versioning, REMOVE the /${project.version} from the <distFilesRoot>-->
        <!--property, below. PLEASE, NOTE: If your ${project.version} is a "-SNAPSHOT"-->
        <!--version, THIS will be used as your directory structure. If you do NOT want-->
        <!--this, simply remove the "-SNAPSHOT" from your <version> declaration at the-->
        <!--top of pom.xml &ndash;&gt;-->
        <!--<distFilesRoot>/appl/${project.artifactId}/${project.version}</distFilesRoot>-->
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jdk.tools</groupId>
            <artifactId>jdk.tools</artifactId>
            <version>1.8</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <version>0.7.9</version>
            <classifier>runtime</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <configuration>
                    <excludes>
                        <!-- These three need to be included again at some point -->
                        <exclude>**/AbstractGremlinChampGraph*</exclude>
                        <exclude>**/DseChampGraphImpl*</exclude>
                        <exclude>**/DseChampformer*</exclude>
                        <!-- Permanently excluded, not worth testing -->
                        <exclude>**/ChampAPIPerformanceTest*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <!--  implementation is needed only for Maven 2  -->
                                <rule implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>BUNDLE</element>
                                    <limits>
                                        <!--  implementation is needed only for Maven 2  -->
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>.15</minimum>
                                        </limit>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>.12</minimum>
                                        </limit>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>.15</minimum>
                                        </limit>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>.10</minimum>
                                        </limit>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>METHOD</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>.17</minimum>
                                        </limit>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>CLASS</counter>
                                            <value>MISSEDCOUNT</value>
                                            <maximum>5</maximum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</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-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.2</version>
                <configuration>
                    <systemPropertyVariables>
                        <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>License.txt</header>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.ksh</include>
                        <include>**/*.sh</include>
                        <include>**/*.ftl</include>
                        <include>**/*.xsd</include>
                        <include>**/*.xjb</include>
                        <include>**/*.yml</include>
                        <include>**/*.yaml</include>
                        <include>**/aai*.xml</include>
                        <include>**/*logback*.xml</include>
                        <include>**/*aaiconfig*.properties</include>
                        <include>**/*titan*.properties</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>
        </plugins>
    </build>
</project>