<!--
  ~ Copyright 2024-2026 Chrimle
  ~
  ~ 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <!-- === Parent === -->
    <parent>
        <groupId>io.github.chrimle</groupId>
        <artifactId>chrimle-oss-parent</artifactId>
        <version>0.15.0</version>
    </parent>

    <!-- === Project Coordinates === -->
    <artifactId>openapi-to-java-records-mustache-templates-parent</artifactId>
    <version>3.11.0</version>
    <packaging>pom</packaging>

    <!-- === Sub Modules === -->
    <modules>
        <module>mustache-templates</module>
        <module>test</module>
    </modules>

    <!-- Project Information -->
    <name>OpenAPI to Java records :: Mustache Templates :: Parent</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>
            <email>openapi2javarecords@protonmail.com</email>
        </developer>
    </developers>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/Chrimle/openapi-to-java-records-mustache-templates/issues</url>
    </issueManagement>
    <ciManagement>
        <system>github-actions</system>
        <url>https://github.com/Chrimle/openapi-to-java-records-mustache-templates/actions</url>
    </ciManagement>
    <!-- / 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>
        <maven.plugin.validation>VERBOSE</maven.plugin.validation>

        <!-- Build Plugin Versions -->
        <openapi-generator-maven-plugin.version>7.24.0</openapi-generator-maven-plugin.version>
        <!-- / Build Plugin Versions -->
    </properties>

    <scm>
        <connection>scm:git:git://github.com/chrimle/openapi-to-java-records-mustache-templates.git</connection>
        <developerConnection>scm:git:ssh://github.com:chrimle/openapi-to-java-records-mustache-templates.git</developerConnection>
        <url>http://github.com/chrimle/openapi-to-java-records-mustache-templates/tree/main</url>
    </scm>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- Used for Copying & Filtering Mustache Templates for reusability -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                </plugin>
                <!-- Common openapi-generator-maven-plugin Version -->
                <plugin>
                    <groupId>org.openapitools</groupId>
                    <artifactId>openapi-generator-maven-plugin</artifactId>
                    <version>${openapi-generator-maven-plugin.version}</version>
                </plugin>
                <!-- Override Parent Configuration -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <excludeArtifacts>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-common</excludeArtifact>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-java</excludeArtifact>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-java-usejakartaee</excludeArtifact>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-spring</excludeArtifact>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-parent</excludeArtifact>
                            <excludeArtifact>openapi-to-java-records-mustache-templates-test-utils</excludeArtifact>
                        </excludeArtifacts>
                    </configuration>
                </plugin>
                <!-- Override Parent Configuration -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Enable Deployment to GitHub Packages -->
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <!-- === Profiles === -->
    <profiles>
        <profile>
            <id>skip-errorprone</id>
            <activation>
                <property>
                    <name>env.CI</name>
                </property>
            </activation>
            <properties>
                <errorProneArg/>
            </properties>
        </profile>
    </profiles>
</project>
