<?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>

    <groupId>org.atp-fivt</groupId>
    <artifactId>export-maven-plugin</artifactId>
    <version>1.5</version>
    <packaging>maven-plugin</packaging>

    <name>Maven project export plugin</name>
    <description>Exports maven project to a zip file respecting .gitignore</description>
    <url>https://github.com/atp-mipt/maven-export-plugin</url>

    <organization>
        <name>MIPT/FIVT/ATP</name>
        <url>https://mipt.ru/education/chairs/programmingtechnolgy/</url>
    </organization>

    <scm>
        <url>https://github.com/atp-mipt/maven-export-plugin.git</url>
        <connection>scm:git:git://github.com/atp-mipt/maven-export-plugin.git</connection>
        <developerConnection>scm:git:git://github.com/atp-mipt/maven-export-plugin.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <name>Ivan Ponomarev</name>
            <email>ponomarev@phystech.edu</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Artifact bytecode/API level: the plugin runs on Maven hosted by JDK 17+ -->
        <maven.compiler.release>17</maven.compiler.release>
        <maven.version>3.9.16</maven.version>
        <checkstyle.maven.plugin.version>3.6.0</checkstyle.maven.plugin.version>
        <maven.enforcer.plugin.version>3.6.3</maven.enforcer.plugin.version>
        <maven.surefire.plugin.version>3.5.6</maven.surefire.plugin.version>
        <checkstyle.version>13.7.0</checkstyle.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jgit</groupId>
            <artifactId>org.eclipse.jgit</artifactId>
            <version>7.7.0.202606012155-r</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.15.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>6.1.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer.plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-build-environment</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.9,3.10)</version>
                                    <message>This build requires Maven 3.9.x.</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <!-- Build JDK: Checkstyle 13.x needs 21+. The produced
                                         artifact targets Java 17 (maven.compiler.release). -->
                                    <version>[21,)</version>
                                    <message>This build requires JDK 21 or newer.</message>
                                </requireJavaVersion>
                                <!-- POM sanity checks -->
                                <banDuplicatePomDependencyVersions/>
                                <requireUpperBoundDeps/>
                                <requireReleaseDeps>
                                    <message>No SNAPSHOT dependencies are allowed in a release build.</message>
                                </requireReleaseDeps>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.15.2</version>
                <configuration>
                    <!-- <goalPrefix>maven-archetype-plugin</goalPrefix> -->
                    <!--<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>-->
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <!-- run before the GPG “verify” phase so the JAR gets signed -->
                        <phase>prepare-package</phase>
                        <goals>
                            <!-- jar-no-fork = no extra compile cycle -->
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <!-- silence doclint warnings that break the build on JDK 8+ -->
                    <source>${maven.compiler.release}</source>
                    <doclint>none</doclint>
                    <failOnError>false</failOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.8</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.11.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>validated</waitUntil>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
