<?xml version="1.0" encoding="UTF-8"?>
<!--

  ~ Copyright (C) 2020-2022 Huawei Technologies Co., Ltd. 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>com.huaweicloud</groupId>
    <artifactId>spring-cloud-huawei-dependencies</artifactId>
    <version>1.10.11-2021.0.x</version>
    <relativePath>../spring-cloud-huawei-dependencies</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <artifactId>spring-cloud-huawei-parents</artifactId>
  <packaging>pom</packaging>
  <version>1.10.11-2021.0.x</version>
  <name>Spring Cloud Huawei::Parents</name>

  <dependencies>
    <!-- unit test-->
    <dependency>
      <groupId>org.jmockit</groupId>
      <artifactId>jmockit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>it</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eluder.coveralls</groupId>
              <artifactId>coveralls-maven-plugin</artifactId>
              <version>4.3.0</version>
              <configuration>
                <jacocoReports>
                  <jacocoReport>${project.basedir}/coverage-reports/target/site/jacoco-aggregate/jacoco.xml
                  </jacocoReport>
                </jacocoReports>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>0.8.2</version>
              <configuration>
                <excludes>
                  <exclude>*$Impl_*</exclude>
                </excludes>
              </configuration>
              <executions>
                <execution>
                  <id>default-prepare-agent</id>
                  <goals>
                    <goal>prepare-agent</goal>
                  </goals>
                  <configuration>
                    <destFile>${project.build.directory}/jacoco.exec</destFile>
                  </configuration>
                </execution>
                <execution>
                  <id>default-prepare-agent-integration</id>
                  <phase>pre-integration-test</phase>
                  <goals>
                    <goal>prepare-agent-integration</goal>
                  </goals>
                  <configuration>
                    <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                    <propertyName>jacoco.failsafe.argLine</propertyName>
                  </configuration>
                </execution>
                <execution>
                  <id>default-report</id>
                  <goals>
                    <goal>report</goal>
                  </goals>
                </execution>
                <execution>
                  <id>default-report-integration</id>
                  <goals>
                    <goal>report-integration</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <compilerArgument>-parameters</compilerArgument>
            <source>1.8</source>
            <target>1.8</target>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
            <compilerArgs>
              <arg>-Werror</arg>
              <arg>-Xlint:all</arg>
              <!--not care for jdk8/jdk7 compatible problem-->
              <arg>-Xlint:-classfile</arg>
              <!--not care for annotations not processed-->
              <arg>-Xlint:-processing</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>com.github.odavid.maven.plugins</groupId>
          <artifactId>mixin-maven-plugin</artifactId>
          <version>0.1-alpha-40</version>
          <extensions>true</extensions>
        </plugin>
        <plugin>
          <groupId>org.commonjava.maven.plugins</groupId>
          <artifactId>directory-maven-plugin</artifactId>
          <version>0.3.1</version>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.20.0</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.16.0</version>
        <configuration>
          <excludes>
            <!--            <exclude>**/RouterServiceInstanceListSupplier.java</exclude>-->
            <!--            <exclude>**/com/huaweicloud/router/client/loabalancer/**</exclude>-->
            <exclude>**/discovery*/price*/**</exclude>
            <!--            <exclude>**/*router-client/**</exclude>-->
          </excludes>
          <excludeRoots>
            <excludeRoot>**/integration*/**</excludeRoot>
          </excludeRoots>
        </configuration>
        <reportSets>
          <reportSet><!-- by default, id = "default" -->
            <reports><!-- select non-aggregate reports -->
              <report>pmd</report>
              <report>cpd</report>
            </reports>
          </reportSet>
          <reportSet><!-- aggregate reportSet, to define in poms having modules -->
            <id>aggregate</id>
            <inherited>false</inherited> <!-- don't run aggregate in child modules -->
            <reports>
              <report>aggregate-pmd</report>
              <report>aggregate-cpd</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
</project>