<?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.teamapps</groupId>
    <artifactId>teamapps-message-protocol-maven-plugin</artifactId>
    <version>0.6</version>
    <packaging>maven-plugin</packaging>

    <properties>
        <maven.compiler.release>23</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <name>Maven Plugin for TeamApps Message Protocol</name>
    <description>Maven plugin to generate message and protocol classes</description>
    <url>https://github.com/teamapps-org/teamapps-protocol-schema-maven-plugin</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Matthias Bernstein</name>
            <email>matthias.bernstein@teamapps.org</email>
            <id>matthias-bernstein</id>
        </developer>
        <developer>
            <name>Yann Massard</name>
            <email>yann.massard@teamapps.org</email>
            <id>yamass</id>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/teamapps-org/teamapps-protocol-schema-maven-plugin</url>
        <connection>scm:git:git@github.com:teamapps-org/teamapps-message-protocol-maven-plugin</connection>
        <developerConnection>scm:git:git@github.com:teamapps-org/teamapps-message-protocol-maven-plugin</developerConnection>
        <tag>v0.6</tag>
    </scm>


    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.9.11</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.9.11</version>
        </dependency>

        <dependency>
            <groupId>org.twdata.maven</groupId>
            <artifactId>mojo-executor</artifactId>
            <version>2.4.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.15.2</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>false</useReleaseProfile>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>v@{version}</tagNameFormat>
                    <releaseProfiles>release</releaseProfiles>
                    <pushChanges>true</pushChanges>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <deploymentName>${project.name} ${project.version}</deploymentName>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </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.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.1</version>
                        <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>
                        <version>3.12.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <doclint>none</doclint>
                            <quiet>true</quiet>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>license-handling</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>2.7.0</version>
                        <executions>
                            <execution>
                                <id>download-licenses</id>
                                <goals>
                                    <goal>download-licenses</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>update-project-license</id>
                                <goals>
                                    <goal>update-project-license</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>update-file-header</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>update-file-header</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <projectName>${project.name}</projectName>
                            <organizationName>TeamApps.org</organizationName>
                            <inceptionYear>2022</inceptionYear>
                            <licenseName>apache_v2</licenseName>
                            <processStartTag>========================LICENSE_START=================================</processStartTag>
                            <processEndTag>=========================LICENSE_END==================================</processEndTag>
                            <sectionDelimiter>---</sectionDelimiter>
                            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                            <canUpdateCopyright>true</canUpdateCopyright>
                            <canUpdateDescription>true</canUpdateDescription>
                            <canUpdateLicense>true</canUpdateLicense>
                            <roots>
                                <root>src/main</root>
                                <root>src/test</root>
                                <root>target/generated-sources</root>
                                <root>target/generated-resources</root>
                            </roots>
                            <excludes>
                                <exclude>**/*.json</exclude>
                                <exclude>**/*.svg</exclude>
                                <exclude>**/*.txt</exclude>
                                <exclude>**/*.xml</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
