<?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>nz.ilbb.ag</groupId>
  <artifactId>nzilbb.ag</artifactId>
  <version>1.2.2</version>
  <name>Annotation Graphs</name>
  <packaging>jar</packaging>
  <description>Implementation of an Annotation Graph API for linguistic annotations.</description>
  <url>https://github.com/nzilbb/ag/</url>
  <licenses>
    <license>
      <name>AGPL-3.0-or-later</name>
      <comments>GNU Affero General Public License v3.0 or later</comments>
      <url>https://www.gnu.org/licenses/agpl.txt</url>
      <distribution>manual</distribution><!-- change to repo once it's in there -->
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/nzilbb/ag.git</connection>
    <developerConnection>scm:git:ssh://github.com:nzilbb/ag.git</developerConnection>
    <url>https://github.com/nzilbb/ag/tree/main</url>
  </scm>
  <developers>
    <developer>
      <id>robert</id>
      <name>Robert Fromont</name>
      <email>robert.fromont@canterbury.ac.nz</email>
      <url>https://github.com/robertfromont</url>
      <organization>New Zealand Institute of Language, Brain and Behaviour</organization>
      <organizationUrl>https://www.canterbury.ac.nz/nzilbb/</organizationUrl>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>America/Buenos_Aires</timezone>
    </developer>
  </developers>
  <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>

  <properties>
    <package.path>nzilbb/ag/</package.path>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.json</artifactId>
      <version>1.1.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>10.17.1.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
      <version>4.7.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>    
    <plugins>

      <!-- build altr grammar into classes  -->
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>antlr</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <!-- include org.antlr runtime in our jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.antlr</groupId>
                  <artifactId>antlr4-runtime</artifactId>
                  <version>4.7.2</version>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- add Class-Path to header, so that can execute if other jars are present -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest addDefaultImplementationEntries="true">
              <addClasspath>true</addClasspath>
            </manifest>
            <manifestEntries>
              <Name>${package.path}</Name>
              <Implementation-Title>${project.description}</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>New Zealand Institute of Language, Brain and Behaviour</Implementation-Vendor>
            </manifestEntries>
          </archive>
          <outputDirectory>../bin</outputDirectory>
        </configuration>
      </plugin>
      
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <trimStackTrace>true</trimStackTrace>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <outputDirectory>../docs</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>4.7.2</version>
        </plugin>        
        <!-- 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>
        <plugin>
          <groupId>org.corpus-tools</groupId>
          <artifactId>cff-maven-plugin</artifactId>
          <version>0.6.0</version>
          <configuration>
            <input>template.cff</input>
            <output>${basedir}/../CITATION.cff</output>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.8</version>
        <reportSets>
          <reportSet>
            <reports>
              <!-- <report>cim</report> -->
              <!-- <report>dependencies</report> -->
              <!-- <report>dependency-convergence</report> -->
              <!-- <report>dependency-info</report> -->
              <!-- <report>dependency-management</report> -->
              <!-- <report>distribution-management</report> -->
              <!-- <report>help</report> -->
              <report>index</report>
              <!-- <report>issue-tracking</report> -->
              <report>license</report>
              <!-- <report>mailing-list</report> -->
              <!-- <report>modules</report> -->
              <!-- <report>plugin-management</report> -->
              <!-- <report>plugins</report> -->
              <report>project-team</report>
              <!-- <report>scm</report> -->
              <!-- <report>summary</report> -->
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-javadoc-plugin</artifactId>
        <version>3.2.0</version>
	<configuration>
          <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
          <show>public</show>
          <overview>overview.html</overview>
	  <bottom>&lt;a rel='license' href='http://creativecommons.org/licenses/by-sa/2.0/'&gt;&lt;img alt='CC-BY-SA Creative Commons Licence ' src='/ag/images/cc-by-sa.svg' title='This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Generic License' /&gt;&lt;/a&gt;&lt;a rel='author' href='https://www.canterbury.ac.nz/nzilbb/'&gt;&lt;img src='/ag/images/nzilbb.svg' alt='Te Kāhui Roro Reo | The New Zealand Institute of Language, Brain and Behaviour' title='🄯 ${maven.build.timestamp} NZILBB'&gt;&lt;/a&gt;</bottom>
          <stylesheetfile>javadoc.css</stylesheetfile>
	</configuration>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <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>
            <version>3.2.0</version>
	    <configuration>
              <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
              <show>protected</show>
	      <bottom>&lt;a rel='license' href='http://creativecommons.org/licenses/by-sa/2.0/'&gt;&lt;img alt='CC-BY-SA Creative Commons Licence ' src='/ag/images/cc-by-sa.svg' title='This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Generic License' /&gt;&lt;/a&gt;&lt;a rel='author' href='https://www.canterbury.ac.nz/nzilbb/'&gt;&lt;img src='/ag/images/nzilbb.svg' alt='Te Kāhui Roro Reo | The New Zealand Institute of Language, Brain and Behaviour' title='🄯 ${maven.build.timestamp} NZILBB'&gt;&lt;/a&gt;</bottom>
	    </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>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
