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

<!--
  ~ Copyright 2021 PubCOI.org
  ~
  ~ This program is free software; you can redistribute it and/or
  ~ modify it under the terms of the GNU Lesser General Public
  ~ License as published by the Free Software Foundation; either
  ~ version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public License
  ~ along with this program; if not, write to the Free Software Foundation,
  ~ Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  -->

<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.pubcoi.schemas</groupId>
    <artifactId>parlparse</artifactId>
    <version>1.0.0</version>

    <name>Parlparse data schema</name>
    <url>https://github.com/PubCOI/schema_parlparse</url>
    <description>Java POJOs for data as output by parlparse.</description>

    <scm>
        <connection>scm:git:git@github.com:PubCOI/schema_parlparse.git</connection>
        <developerConnection>scm:git:git@github.com:PubCOI/schema_parlparse.git</developerConnection>
        <url>https://github.com/PubCOI/schema_parlparse</url>
    <tag>parlparse-1.0.0</tag>
  </scm>

    <licenses>
        <license>
            <name>GNU Lesser General Public License v3.0 or later</name>
            <url>https://www.gnu.org/licenses/lgpl-3.0-standalone.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>rmacd</id>
            <name>Ronald MacDonald</name>
            <email>ronald@rmacd.com</email>
            <roles>
                <role>developer</role>
                <role>project-administrator</role>
            </roles>
            <timezone>+00:00</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <version.commons-lang3>3.11</version.commons-lang3>
        <version.jaxb-api>2.3.1</version.jaxb-api>
        <version.jaxb-impl>2.1</version.jaxb-impl>
        <version.javax.activation-api>1.2.0</version.javax.activation-api>
        <version.jaxb2-fluent-api>3.0</version.jaxb2-fluent-api>
        <version.jaxb2-maven-plugin>0.14.0</version.jaxb2-maven-plugin>
        <version.jtexttime>1.2.0</version.jtexttime>

        <version.maven-enforcer-plugin>3.0.0-M3</version.maven-enforcer-plugin>
        <version.maven-source-plugin>3.2.1</version.maven-source-plugin>
        <version.maven-javadoc-plugin>3.2.0</version.maven-javadoc-plugin>
        <version.nexus-staging-maven-plugin>1.6.7</version.nexus-staging-maven-plugin>
        <version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${version.commons-lang3}</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>${version.jaxb-api}</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>javax.activation-api</artifactId>
            <version>${version.javax.activation-api}</version>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${version.jaxb-impl}</version>
        </dependency>
        <dependency>
            <groupId>com.addicticks.oss</groupId>
            <artifactId>jtexttime</artifactId>
            <version>${version.jtexttime}</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults -->
            <plugins>
                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <!-- base non-defaults: -->
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${version.maven-enforcer-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${version.maven-source-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.maven-javadoc-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${version.nexus-staging-maven-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.maven-gpg-plugin}</version>
                </plugin>
                <!-- project defaults -->
                <plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>${version.jaxb2-maven-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicatePomDependencyVersions />
                                <dependencyConvergence />
                                <requireReleaseDeps />
                                <requireMavenVersion>
                                    <version>[3.5,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <!-- Library must be built with 1.8 so that it can be   -->
                                    <!-- imported / used by those still on 1.8:             -->
                                    <!-- export JAVA_HOME=`/usr/libexec/java_home -v 1.8`   -->
                                    <version>[1.8,1.9)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-fluent-api</artifactId>
                        <version>${version.jaxb2-fluent-api}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.addicticks.oss</groupId>
                        <artifactId>jtexttime</artifactId>
                        <version>${version.jtexttime}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <schemaDirectory>src/main/xsd</schemaDirectory>
                    <bindingDirectory>src/main/xjb</bindingDirectory>
                    <forceRegenerate>true</forceRegenerate>
                    <removeOldOutput>false</removeOldOutput>
                    <args>
                        <arg>-Xfluent-api</arg>
                    </args>
                    <verbose>true</verbose>
                    <plugins>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-fluent-api</artifactId>
                            <version>${version.jaxb2-fluent-api}</version>
                        </plugin>
                    </plugins>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk-8-config</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
            </properties>
        </profile>
        <profile>
            <id>jdk-11-config</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <properties>
                <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <configuration>
                            <!-- XSD generated classes, so we're ok to do this -->
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                                <configuration>
                                    <keyname>info@pubcoi.org</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
