<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2024 TU Dortmund University

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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.learnlib.tooling</groupId>
    <artifactId>build-tools-parent</artifactId>
    <version>0.1.1</version>
    <packaging>pom</packaging>

    <name>Build Tools</name>
    <description>Build tools for LearnLib-related projects</description>
    <url>http://github.com/LearnLib/build-tools</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>mtf90</id>
            <name>Markus Frohme</name>
            <email>markus.frohme@udo.edu</email>
            <organization>TU Dortmund University, Chair of Programming Systems</organization>
            <organizationUrl>http://ls5-www.cs.tu-dortmund.de/</organizationUrl>
            <roles>
                <role>Developer</role>
                <role>Maintainer</role>
            </roles>
        </developer>
    </developers>

    <modules>
        <module>annotations</module>
        <module>build-config</module>
        <module>build-parent</module>
        <module>processors</module>
    </modules>

    <scm>
        <connection>scm:git:https://github.com/LearnLib/build-tools.git</connection>
        <developerConnection>scm:git:git@github.com:LearnLib/build-tools.git</developerConnection>
        <url>https://github.com/LearnLib/build-tools/tree/develop</url>
        <tag>build-tools-0.1.1</tag>
    </scm>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/LearnLib/build-tools/issues</url>
    </issueManagement>
    <ciManagement>
        <system>GitHub Actions</system>
        <url>https://github.com/LearnLib/build-tools/actions</url>
    </ciManagement>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- general config -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.release>8</maven.compiler.release>

        <!-- plugin versions -->
        <checkstyle-plugin.version>3.3.0</checkstyle-plugin.version>
        <compiler-plugin.version>3.11.0</compiler-plugin.version>
        <dependency-plugin.version>3.6.0</dependency-plugin.version>
        <deploy-plugin.version>3.1.1</deploy-plugin.version>
        <enforcer-plugin.version>3.4.1</enforcer-plugin.version>
        <gpg-plugin.version>3.1.0</gpg-plugin.version>
        <install-plugin.version>3.1.1</install-plugin.version>
        <jacoco-plugin.version>0.8.8</jacoco-plugin.version>
        <jar-plugin.version>3.3.0</jar-plugin.version>
        <javadoc-plugin.version>3.6.0</javadoc-plugin.version>
        <pmd-plugin.version>3.14.0</pmd-plugin.version>
        <release-plugin.version>3.0.1</release-plugin.version>
        <resources-plugin.version>3.3.1</resources-plugin.version>
        <source-plugin.version>3.3.0</source-plugin.version>
        <spotbugs-plugin.version>4.7.3.6</spotbugs-plugin.version>
        <surefire-plugin.version>3.1.2</surefire-plugin.version>
        <tidy-pom.version>1.2.0</tidy-pom.version>

        <!-- dependency versions -->
        <brics.version>1.12-4</brics.version>
        <checkstyle.version>9.3</checkstyle.version>
        <compile-testing.version>0.21.0</compile-testing.version>
        <extra-enforcer-rules.version>1.7.0</extra-enforcer-rules.version>
        <javadoc-parser.version>0.3.1</javadoc-parser.version>
        <javapoet.version>1.13.0</javapoet.version>
        <mockito.version>5.6.0</mockito.version>
        <testng.version>7.5.1</testng.version>
        <truth.version>1.1.3</truth.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>de.learnlib.tooling</groupId>
                <artifactId>annotations</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>de.learnlib.tooling</groupId>
                <artifactId>build-config</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>de.learnlib.tooling</groupId>
                <artifactId>build-parent</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>de.learnlib.tooling</groupId>
                <artifactId>processors</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.chhorz</groupId>
                <artifactId>javadoc-parser</artifactId>
                <version>${javadoc-parser.version}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup</groupId>
                <artifactId>javapoet</artifactId>
                <version>${javapoet.version}</version>
            </dependency>

            <dependency>
                <groupId>dk.brics</groupId>
                <artifactId>automaton</artifactId>
                <version>${brics.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.testing.compile</groupId>
                <artifactId>compile-testing</artifactId>
                <version>${compile-testing.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.google.truth</groupId>
                <artifactId>truth</artifactId>
                <version>${truth.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc-plugin.version}</version>
                    <configuration>
                        <quiet>true</quiet>
                        <detectLinks>true</detectLinks>
                        <linksource>false</linksource>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${release-plugin.version}</version>
                    <configuration>
                        <!-- Automatically use the parent version for all submodules, do not prompt for each one -->
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>build-tools-@{version}</tagNameFormat>
                        <!-- Perform an install into the local repository, otherwise the javadoc plugin will fail -->
                        <preparationGoals>clean install</preparationGoals>
                        <preparationProfiles>code-analysis</preparationProfiles>
                        <goals>deploy</goals>
                        <!-- explicitly disable preparationProfiles until https://issues.apache.org/jira/browse/MRELEASE-1124 is fixed-->
                        <releaseProfiles>release,bundles,!code-analysis</releaseProfiles>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>prepare-report</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${pmd-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs-plugin.version}</version>
                    <configuration>
                        <effort>Max</effort>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tidy-maven-plugin</artifactId>
                    <version>${tidy-pom.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>code-analysis</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>analyze</id>
                                <!-- default phase is verify -->
                                <goals>
                                    <goal>analyze-only</goal>
                                </goals>
                                <configuration>
                                    <failOnWarning>true</failOnWarning>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-bytecode-version</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <enforceBytecodeVersion>
                                            <maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
                                            <ignoredScopes>test</ignoredScopes>
                                        </enforceBytecodeVersion>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>extra-enforcer-rules</artifactId>
                                <version>${extra-enforcer-rules.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>tidy-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>code-coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bundles</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
