<?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>io.github.dmlloyd.maven</groupId>
    <artifactId>module-services-plugin</artifactId>

    <!-- IMPORTANT: Update README.md-->
    <version>1.3</version>

    <name>Module services plugin</name>
    <description>A Maven plugin to produce a classpath META-INF/services file from a module-info descriptor</description>
    <url>https://github.com/dmlloyd/module-services-plugin</url>

    <scm>
        <url>https://github.com/dmlloyd/module-services-plugin</url>
        <connection>scm:git:git@github.com:dmlloyd/module-services-plugin</connection>
        <developerConnection>scm:git:git@github.com:dmlloyd/module-services-plugin</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>dmlloyd</id>
            <email>dmlloyd@flurg.com</email>
            <name>David Lloyd</name>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/dmlloyd/module-services-plugin/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Dependency versions -->
        <version.junit.junit>4.11</version.junit.junit>
        <version.org.apache.maven.compiler-plugin>3.15.0</version.org.apache.maven.compiler-plugin>
        <version.org.apache.maven.maven-plugin>2.2.1</version.org.apache.maven.maven-plugin>
        <version.org.apache.maven.maven-settings>3.9.12</version.org.apache.maven.maven-settings>
        <version.org.apache.maven.plugin-api>3.9.12</version.org.apache.maven.plugin-api>
        <version.org.apache.maven.plugin-tools>3.15.2</version.org.apache.maven.plugin-tools>
        <version.org.apache.maven.plugins.site-plugin>3.21.0</version.org.apache.maven.plugins.site-plugin>
        <version.org.apache.maven.plugins.maven-dependency-plugin>2.6</version.org.apache.maven.plugins.maven-dependency-plugin>
        <version.org.apache.maven.shared.maven-filtering>3.4.0</version.org.apache.maven.shared.maven-filtering>
        <version.org.codehaus.plexus.plexus-utils>3.5.1</version.org.codehaus.plexus.plexus-utils>
    </properties>

    <packaging>maven-plugin</packaging>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${version.org.apache.maven.plugin-tools}</version>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.org.apache.maven.compiler-plugin}</version>
                <dependencies>
                </dependencies>
                <configuration>
                    <proc>full</proc>
                </configuration>
            </plugin>
            <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.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${version.org.apache.maven.plugins.site-plugin}</version>
                <configuration>
                    <relativizeDecorationLinks>false</relativizeDecorationLinks>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${version.org.apache.maven.plugin-tools}</version>
                <configuration>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    <extractors>
                        <extractor>java-annotations</extractor>
                    </extractors>
                    <goalPrefix>module-services</goalPrefix>
                </configuration>
                <dependencies>
                    <!-- Avoid ASM errors -->
                    <dependency>
                        <groupId>org.apache.maven.plugin-tools</groupId>
                        <artifactId>maven-plugin-tools-annotations</artifactId>
                        <version>${version.org.apache.maven.plugin-tools}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>9.9.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <!-- if you want to generate help goal -->
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                        <configuration>
                            <helpPackageName>io.github.dmlloyd.maven</helpPackageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.10.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <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>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>io.github.dmlloyd</groupId>
            <artifactId>jdk-classfile-backport</artifactId>
            <version>25.1</version>
        </dependency>

        <dependency>
            <groupId>org.sonatype.sisu</groupId>
            <artifactId>sisu-inject-bean</artifactId>
            <version>2.6.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- maven plugin dependencies -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${version.org.apache.maven.plugin-api}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>${version.org.apache.maven.maven-plugin}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-filtering</artifactId>
            <version>${version.org.apache.maven.shared.maven-filtering}</version>
            <scope>provided</scope>
        </dependency>

        <!-- dependencies to annotations -->
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${version.org.apache.maven.plugin-tools}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-tools-annotations</artifactId>
            <version>${version.org.apache.maven.plugin-tools}</version>
            <scope>provided</scope>
        </dependency>

        <!-- generated help mojo has a dependency to plexus-utils -->
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>${version.org.codehaus.plexus.plexus-utils}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-settings</artifactId>
            <version>${version.org.apache.maven.maven-settings}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>