<?xml version="1.0" encoding="UTF-8"?>
<!--
~   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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>44</version>
        <relativePath />
    </parent>

    <groupId>org.kitei.internal</groupId>
    <artifactId>kitei-root</artifactId>
    <version>7</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.targetJdk>17</project.build.targetJdk>
        <project.build.systemJdk>[17,)</project.build.systemJdk>

        <!-- till next basepom relase -->
        <dep.spotbugs.version>4.7.0</dep.spotbugs.version>

        <dep.kitei-rules.version>7</dep.kitei-rules.version>

        <!-- multi-module projects should deploy at the end -->
        <basepom.at-end.deploy>true</basepom.at-end.deploy>
        <basepom.at-end.install>false</basepom.at-end.install>

        <!-- only level 5 pmd allows the builds to pass. -->
        <basepom.pmd.fail-level>4</basepom.pmd.fail-level>

        <!-- fail on all checkstyle violations -->
        <basepom.check.checkstyle-severity>warning</basepom.check.checkstyle-severity>

        <!-- do not fail on javadoc errors -->
        <basepom.check.fail-javadoc>false</basepom.check.fail-javadoc>

        <basepom.release.profiles>basepom.oss-release,kitei-release</basepom.release.profiles>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <configuration>
                        <!-- MDEP-804 -->
                        <ignoredNonTestScopedDependencies>
                            <ignoreNonTestScopedDependency>*</ignoreNonTestScopedDependency>
                        </ignoredNonTestScopedDependencies>
                    </configuration>
                </plugin>

                <!-- Load the pmd rules from the kitei-rules jar -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.kitei.internal</groupId>
                            <artifactId>kitei-rules</artifactId>
                            <version>${dep.kitei-rules.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <rulesets>
                            <ruleset>pmd/kitei.xml</ruleset>
                        </rulesets>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.kitei.internal</groupId>
                            <artifactId>kitei-rules</artifactId>
                            <version>${dep.kitei-rules.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <configLocation>checkstyle/kitei.xml</configLocation>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>org.kitei.internal</groupId>
                            <artifactId>kitei-rules</artifactId>
                            <version>${dep.kitei-rules.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <excludeFilterFile>spotbugs/kitei-exclusions.xml</excludeFilterFile>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!-- Continuous integration profile, enables additional checks: findbugs, pmd, checkstyle -->
        <profile>
            <id>kitei-release</id>
            <properties>
                <!-- unit and integration tests were run in the preparation step
                     of the release, can be skipped here -->
                <basepom.test.skip>true</basepom.test.skip>
                <basepom.it.skip>true</basepom.it.skip>
                <basepom.check.skip-all>true</basepom.check.skip-all>
                <basepom.check.skip-javadoc>false</basepom.check.skip-javadoc>
            </properties>
        </profile>
    </profiles>
</project>
