<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Copyright 2019–2021, California Institute of Technology ("Caltech"). U.S. 
     Government sponsorship acknowledged. All rights reserved. Redistribution 
     and use in source and binary forms, with or without modification, are permitted 
     provided that the following conditions are met: - Redistributions of source 
     code must retain the above copyright notice, this list of conditions and 
     the following disclaimer. - Redistributions must reproduce the above copyright 
     notice, this list of conditions and the following disclaimer in the documentation 
     and/or other materials provided with the distribution. - Neither the name 
     of Caltech nor its operating division, the Jet Propulsion Laboratory, nor 
     the names of its contributors may be used to endorse or promote products 
     derived from this software without specific prior written permission. THIS 
     SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
     IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
     USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- Inherit release profile, reporting, SNAPSHOT repo, etc. from parent 
       repo -->
  <parent>
    <groupId>gov.nasa</groupId>
    <artifactId>pds</artifactId>
    <version>1.18.0</version>
  </parent>

  <groupId>gov.nasa.pds</groupId>
  <artifactId>harvest</artifactId>
  <version>4.0.2</version>
  <packaging>jar</packaging>

  <name>Harvest Tool</name>
  <description>
    The Harvest Tool provides functionality for capturing and indexing product metadata. 
    The tool will run locally at the Discipline Node to crawl the local data repository in order to 
    discover products and index associated metadata with the Registry Service.
  </description>

  <url>https://nasa-pds.github.io/harvest/</url>

  <inceptionYear>2010</inceptionYear>

  <organization>
    <name>Jet Propulsion Laboratory, California Institute of Technology</name>
  </organization>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/NASA-PDS/harvest</url>
    <connection>scm:git:ssh://git@github.com/NASA-PDS/harvest.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/NASA-PDS/harvest.git</developerConnection>
  </scm>

  <properties>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <!-- Command line interface / parameters -->
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.9.0</version>
    </dependency>
    <!-- XML escaping, String utils -->
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <!-- Hex encoding -->
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.17.1</version>
    </dependency>
    <!-- File type detection -->
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-core</artifactId>
      <version>1.28.3</version>
    </dependency>
    <!-- Google JSON parser / writer -->
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.11.0</version>
    </dependency>
    <!-- XML to JSON converter -->
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20231013</version>
    </dependency>
    <!-- Registry Common library -->
    <dependency>
      <groupId>gov.nasa.pds</groupId>
      <artifactId>registry-common</artifactId>
      <version>2.1.0-SNAPSHOT</version>
    </dependency>
    <!-- rich XML parsing -->
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
      <version>12.5</version>
    </dependency>
    <!-- unit testing module -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.10.3</version>
      <scope>test</scope>
    </dependency>
    <!-- three (3) artifacts for complete configuration parsing -->
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <version>4.0.2</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>4.0.5</version>
    </dependency>
    <dependency>
      <groupId>jakarta.activation</groupId>
      <artifactId>jakarta.activation-api</artifactId>
      <version>2.1.2</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Add POM version to JAR's manifest -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-Time>${maven.build.timestamp}</Build-Time>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <!-- SpringBoot single JAR executable. -->
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.2.5.RELEASE</version>
        <configuration>
          <mainClass>gov.nasa.pds.harvest.HarvestMain</mainClass>
          <layout>JAR</layout>
        </configuration>
        <executions>
          <execution>
            <id>exec-jar</id>
            <phase>package</phase>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Binary release (ZIP and tar.gz). -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.7.1</version>
        <executions>
          <execution>
            <id>bin-release</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/tar-assembly.xml</descriptor>
                <descriptor>src/main/assembly/zip-assembly.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Disable Site for now -->
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <skip>true</skip>
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>
      <!-- Java Docs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <detectJavaApiLink>false</detectJavaApiLink>
        </configuration>
      </plugin>
      <!-- Add maven source for maven central deployment -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>make-source-jar</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>jar-no-fork</goal>
              <goal>test-jar-no-fork</goal>
            </goals>
            <configuration>
              <excludeResources>true</excludeResources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
