<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2024 Evolved Binary

    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>

    <groupId>xyz.elemental.expath</groupId>
    <artifactId>elemental-expath-package-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>

    <name>Elemental EXPath Package parent POM</name>
    <description>Maven parent POM for Elemental EXPath Packages</description>
    <url>https://www.github.com/evolvedbinary/elemental-expath-package-parent</url>
    <inceptionYear>2024</inceptionYear>

    <organization>
        <name>Evolved Binary</name>
        <url>https://www.evolvedbinary.com</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://opensource.org/license/apache-2-0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://www.github.com/evolvedbinary/elemental-expath-package-parent.git</url>
        <connection>scm:git:https://www.github.com/evolvedbinary/elemental-expath-package-parent.git</connection>
        <developerConnection>scm:git:https://www.github.com/evolvedbinary/elemental-expath-package-parent.git
        </developerConnection>
      <tag>elemental-expath-package-parent-1.2.0</tag>
  </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://www.github.com/evolvedbinary/elemental-expath-package-parent/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <id>adamretter</id>
            <name>Adam Retter</name>
            <email>adam@evolvedbinary.com</email>
            <organization>Evolved Binary</organization>
            <organizationUrl>https://www.evolvedbinary.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.source>1.8</project.build.source>
        <project.build.target>1.8</project.build.target>

        <package-title>${project.name}</package-title>
        <package-abbrev>${project.artifactId}</package-abbrev>
        <package-final-name>${project.artifactId}-${project.version}</package-final-name>
    </properties>

    <dependencyManagement>
        <!-- Test dependencies -->
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-core</artifactId>
                <version>2.11.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.9.0</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.6</version>
                </plugin>
                <plugin>
                    <groupId>com.code54.mojo</groupId>
                    <artifactId>buildversion-plugin</artifactId>
                    <version>1.0.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xml-maven-plugin</artifactId>
                    <version>1.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.14.1</version>
                    <configuration>
                        <source>${project.build.source}</source>
                        <target>${project.build.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>ro.kuberam.maven.plugins</groupId>
                    <artifactId>kuberam-expath-plugin</artifactId>
                    <version>0.6.3</version>
                    <executions>
                        <execution>
                            <id>create-xar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>make-xar</goal>
                            </goals>
                            <configuration>
                                <descriptor>xar-assembly.xml</descriptor>
                                <finalName>${package-final-name}</finalName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Git-Commit-Timestamp>${build-tstamp}</Git-Commit-Timestamp>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <!-- Attach source jars -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Git-Commit-Timestamp>${build-tstamp}</Git-Commit-Timestamp>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Attach javadoc jars -->
                <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>
                        <source>${project.build.source}</source>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Git-Commit-Timestamp>${build-tstamp}</Git-Commit-Timestamp>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.9.0</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <headerDefinitions>
                        <headerDefinition>xquery-license-style.xml</headerDefinition>
                    </headerDefinitions>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                        <xconf>XML_STYLE</xconf>
                        <xq>XQUERY_STYLE</xq>
                        <xql>XQUERY_STYLE</xql>
                        <xqm>XQUERY_STYLE</xqm>
                        <xsl>XML_STYLE</xsl>
                        <xslt>XML_STYLE</xslt>
                    </mapping>
                    <licenseSets>
                        <licenseSet>
                            <header>com/mycila/maven/plugin/license/templates/APACHE-2-noemail.txt</header>
                            <properties>
                                <year>${project.inceptionYear}</year>
                                <owner>${project.organization.name}</owner>
                            </properties>
                            <excludes>
                                <exclude>.gitignore</exclude>
                                <exclude>.idea/</exclude>
                                <exclude>.mvn/</exclude>
                                <exclude>mvnw</exclude>
                                <exclude>mvnw.cmd</exclude>
                                <exclude>README.md</exclude>
                                <exclude>LICENSE</exclude>
                                <exclude>xquery-license-style.xml</exclude>
                                <exclude>xar-assembly.xml</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.code54.mojo</groupId>
                <artifactId>buildversion-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>set-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <configuration>
                    <useAgent>true</useAgent>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>${project.artifactId}-@{project.version}</tagNameFormat>
                    <releaseProfiles>elemental-expath-package-release</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>

    </build>

    <profiles>
        <profile>
            <!-- NOTE(AR) This profile will be activated by the maven-release-plugin -->
            <id>elemental-expath-package-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <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>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <deploymentName>${project.artifactId}-${project.version}</deploymentName>
                            <failOnBuildFailure>true</failOnBuildFailure>
                            <waitUntil>validated</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <pluginRepositories>
        <pluginRepository>
            <id>clojars.org</id>
            <url>https://clojars.org/repo</url>
        </pluginRepository>
    </pluginRepositories>

</project>
