<?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>uk.gov.nationalarchives</groupId>
    <artifactId>csv-validator-parent</artifactId>
    <version>1.3.0</version>
    <packaging>pom</packaging>

    <name>csv-validator-parent</name>
    <description>Validation tool for CSV and CSV Schema files</description>
    <url>https://digital-preservation.github.io/csv-validator/</url>
    <inceptionYear>2013</inceptionYear>

    <organization>
        <name>The National Archives</name>
        <url>https://www.nationalarchives.gov.uk</url>
    </organization>

    <developers>
        <developer>
            <name>David Ainslie</name>
        </developer>
        <developer>
            <name>Jim Collins</name>
        </developer>
        <developer>
            <name>Andy Hicks</name>
        </developer>
        <developer>
            <name>Ben Parker</name>
        </developer>
        <developer>
            <name>Adam Retter</name>
        </developer>
        <developer>
            <name>Laura Damian</name>
        </developer>
        <developer>
            <name>Radek Hubner</name>
        </developer>
        <developer>
            <name>Valy Diarrassouba</name>
        </developer>
	    <developer>
            <name>Luke Tebbs</name>
	        <email>luke@luketebbs.com</email>
	    </developer>
        <developer>
            <name>Saurabh Parkhi</name>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Nicola Welch</name>
        </contributor>
        <contributor>
            <name>Alex Green</name>
        </contributor>
        <contributor>
            <name>David Underdown</name>
        </contributor>
        <contributor>
            <name>Eric Torreborre</name>
        </contributor>
    </contributors>

    <licenses>
        <license>
            <name>The Mozilla Public License Version 2.0</name>
            <url>https://opensource.org/licenses/MPL-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/digital-preservation/csv-validator.git</connection>
        <developerConnection>scm:git:https://github.com/digital-preservation/csv-validator.git</developerConnection>
        <url>scm:git:https://github.com/digital-preservation/csv-validator.git</url>
      <tag>1.3.0</tag>
    </scm>

    <profiles>
        <!-- this profile signs the jars before publishing, if the jars are not signed, the deployment to maven central fails   -->
        <!-- when doing a release, just run mvn release:perform -Prelease-sign-artifacts for this to work. It will ask for the  -->
        <!-- gpg passphrase when run. It assumes that you have a gpg key setup properly        -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <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>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>sonatype-nexus-snapshot-staging</id>
                    <name>Nexus Snapshot Repository</name>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>sonatype-nexus-release-staging</id>
                    <name>Nexus Release Repository</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>

        <!-- Profile for publishing artifacts to GitHub -->
        <!-- See: https://github.com/digital-preservation/csv-validator/releases -->
        <profile>
            <id>github-release-repo</id>
            <distributionManagement>
                <repository>
                    <id>github-release-staging</id>
                    <name>GitHub Release Repository</name>
                    <url>https://maven.pkg.github.com/digital-preservation/csv-validator</url>
                </repository>
            </distributionManagement>
        </profile>

    </profiles>

    <properties>
        <scala.version>2.13</scala.version>
        <scala.lib.version>2.13.12</scala.lib.version>
        <cats.core.version>2.10.0</cats.core.version>
        <cats.effect.version>3.5.1</cats.effect.version>
        <specs2.version>4.20.2</specs2.version>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <contact.email>digitalpreservation@nationalarchives.gov.uk</contact.email>
    </properties>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>4.8.1</version>
                    <configuration>
                        <scalaVersion>${scala.lib.version}</scalaVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>
                <plugin>
                    <groupId>com.code54.mojo</groupId>
                    <artifactId>buildversion-plugin</artifactId>
                    <version>1.0.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>appassembler-maven-plugin</artifactId>
                    <version>2.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <inlineHeader><![CDATA[
Copyright (c) ${project.inceptionYear}, ${project.organization.name} <${contact.email}>
${project.organization.url}

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
                    ]]></inlineHeader>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <excludes>
                        <exclude>**/pom.xml</exclude>
                        <exclude>**/*.sbt</exclude>
                        <exclude>**/project/**</exclude>
                        <exclude>**/.github/**</exclude>
                        <exclude>**/appveyor.yml</exclude>
                        <exclude>**/csv-schema-grammar.ebnf</exclude>
                        <exclude>**/README.md</exclude>
                        <exclude>**/LICENSE</exclude>
                        <exclude>**/*.csvs</exclude>
                        <exclude>**/*.csv</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.jp2</exclude>
                        <exclude>**/src/*/resources/**</exclude>
                        <exclude>**/.*/**</exclude>
                    </excludes>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>check-headers</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </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-jar-plugin</artifactId>
                <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>
                            <Build-Version>${build-version}</Build-Version>
                            <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                            <Source-Repository>${project.scm.connection}</Source-Repository>
                            <Description>${project.description}</Description>
                            <Implementation-URL>${project.url}</Implementation-URL>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <!-- Attach source jars -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <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>
                            <Build-Version>${build-version}</Build-Version>
                            <Build-Timestamp>${build-tstamp}</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>
            <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>
                    <mavenExecutorId>forked-path</mavenExecutorId> <!-- avoid a bug with GPG plugin hanging https://jira.codehaus.org/browse/MGPG-9 -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-releases</id>
            <url>https://oss.sonatype.org/content/repositories/releases</url>
        </pluginRepository>
        <pluginRepository>
            <id>clojars.org</id>
            <url>https://clojars.org/repo</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.lib.version}</version>
            </dependency>
            <dependency>
                <groupId>org.typelevel</groupId>
                <artifactId>cats-core_${scala.version}</artifactId>
                <version>${cats.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.typelevel</groupId>
                <artifactId>cats-kernel_${scala.version}</artifactId>
                <version>${cats.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.typelevel</groupId>
                <artifactId>cats-effect_${scala.version}</artifactId>
                <version>${cats.effect.version}</version>
            </dependency>
            <dependency>
                <groupId>org.typelevel</groupId>
                <artifactId>cats-effect-kernel_${scala.version}</artifactId>
                <version>${cats.effect.version}</version>
            </dependency>
            <dependency>
                <groupId>org.specs2</groupId>
                <artifactId>specs2-core_${scala.version}</artifactId>
                <version>${specs2.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.specs2</groupId>
                <artifactId>specs2-common_${scala.version}</artifactId>
                <version>${specs2.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.specs2</groupId>
                <artifactId>specs2-matcher_${scala.version}</artifactId>
                <version>${specs2.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.specs2</groupId>
                <artifactId>specs2-junit_${scala.version}</artifactId>
                <version>${specs2.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>
