<?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>
    <parent>
        <groupId>io.github.chrimle</groupId>
        <artifactId>openapi-to-java-records-mustache-templates-parent</artifactId>
        <version>3.1.1</version>
    </parent>

    <artifactId>openapi-to-java-records-mustache-templates</artifactId>
    <packaging>jar</packaging>

    <!-- Project Information -->
    <name>OpenAPI to Java records :: Mustache Templates</name>
    <description>Project containing Mustache-templates used by openapi-generator-maven-plugin to generate Java records from OpenAPI Specifications.</description>
    <inceptionYear>2024</inceptionYear>
    <url>https://chrimle.github.io/openapi-to-java-records-mustache-templates/</url>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <organization>
        <name>openapi-to-java-records-mustache-templates</name>
        <url>https://chrimle.github.io/openapi-to-java-records-mustache-templates/</url>
    </organization>
    <developers>
        <developer>
            <id>Chrimle</id>
            <name>Christopher Molin</name>
            <roles>
                <role>Lead Developer</role>
            </roles>
            <timezone>CET</timezone>
            <url>https://www.chrimle.com</url>
        </developer>
    </developers>
    <!-- / Project Information -->

    <distributionManagement>
        <repository>
            <id>github</id>
            <name>GitHub Chrimle Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/chrimle/openapi-to-java-records-mustache-templates</url>
        </repository>
        <snapshotRepository>
            <id>github</id>
            <name>GitHub Chrimle Apache Maven Snapshot Packages</name>
            <url>https://maven.pkg.github.com/chrimle/openapi-to-java-records-mustache-templates</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- Location of updated `.mustache` template files -->
        <original-mustache-templates-directory>src/main/resources/templates</original-mustache-templates-directory>
        <updated-mustache-templates-directory>${project.build.outputDirectory}/templates</updated-mustache-templates-directory>
    </properties>

    <build>
        <plugins>
            <!-- Propagate Maven Project properties to any variables, such as '${project.version}' -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>propagate-maven-project-properties</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${original-mustache-templates-directory}</directory>
                                    <includes>
                                        <include>**/*.mustache</include>
                                    </includes>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                            <outputDirectory>${updated-mustache-templates-directory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*.mustache</include>
                        <include>**/LICENSE.txt</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>