<?xml version="1.0" encoding="UTF-8"?>
<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.qubership.atp.environments</groupId>
        <artifactId>parent-dependencies</artifactId>
        <version>2.0.2</version>
        <relativePath>../parent-dependencies/pom.xml</relativePath>
    </parent>

    <artifactId>parent-java</artifactId>
    <name>parent-java</name>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <console.encoding>UTF-8</console.encoding>
        <svn.revision>local_build</svn.revision>
        <maven-pmd-plugin.version>3.8</maven-pmd-plugin.version>
        <pmd.version>7.0.0</pmd.version>
    </properties>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>with-analyzers</id>
            <activation>
                <property>
                    <name>enable-analyzers</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <!--Transforms xml output of spotbugs plugin into readable html-->
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>1.0.1</version>
                        <configuration>
                            <transformationSets>
                                <transformationSet>
                                    <!--Configures the source directory of XML files.-->
                                    <dir>${project.build.directory}/spotbugs/xml</dir>
                                    <!--Configures the directory in which the SpotBugs report is written.-->
                                    <outputDir>${project.build.directory}/spotbugs/report</outputDir>
                                    <!--Selects the used stylesheet.
                                    Supported are: default.xsl; color.xsl; fancy.xsl; fancy-hist.xsl; plain.xsl; summary.xsl;
                                    located in com.github.spotbugs:spotbugs -->
                                    <stylesheet>fancy-hist.xsl</stylesheet>
                                    <fileMappers>
                                        <!--Configures the file extension of the output files.-->
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                            <targetExtension>.html</targetExtension>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                        <executions>
                            <!--Ensures that the XSLT transformation is run when the project is compiled.-->
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>transform</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.github.spotbugs</groupId>
                                <artifactId>spotbugs</artifactId>
                                <version>3.1.8</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok-mapstruct-binding</artifactId>
                                <version>0.2.0</version>
                            </path>
                        </annotationProcessorPaths>
                        <release>${java.version}</release>
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.1</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <overWriteReleases>true</overWriteReleases>
                                <overWriteSnapshots>true</overWriteSnapshots>
                                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                                <includeScope>runtime</includeScope>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.5</version>
                    <configuration>
                        <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
                        <systemPropertyVariables>
                            <logback.debug>true</logback.debug>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>