<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>
  <groupId>de.gwdg.metadataqa</groupId>
  <artifactId>metadata-qa-api</artifactId>
  <packaging>jar</packaging>
  <version>0.9.2</version>
  <name>Metadata Quality Assurance Framework API</name>
  <description>
    A metadata quality assurance framework. It checks some metrics of 
    metadata records, such as completeness, uniqueness, problem catalog.
  </description>

  <developers>
    <developer>
      <name>Péter Király</name>
      <email>peter.kiraly@gwdg.de</email>
      <roles>
        <role>developer</role>
      </roles>
      <organization>
        Gesellschaft für wissenschaftliche Datenverarbeitung mbH Göttingen (GWDG)
      </organization>
      <organizationUrl>http://gwdg.de/</organizationUrl>
    </developer>
  </developers>
  <url>http://pkiraly.github.io</url>

  <licenses>
    <license>
      <name>GNU General Public License, Version 3.0</name>
      <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:pkiraly/metadata-qa-api.git</connection>
    <developerConnection>scm:git:git@github.com:pkiraly/metadata-qa-api.git</developerConnection>
    <url>http://github.com/pkiraly/metadata-qa-api</url>
  </scm>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11.0</maven.compiler.source>
    <maven.compiler.target>11.0</maven.compiler.target>
    <skipSource>true</skipSource>
    <skipGpg>true</skipGpg>
    <skipStaging>true</skipStaging>
    <skipJavadoc>true</skipJavadoc>
    <project.timezone>UTC</project.timezone>
    <project.language>en</project.language>
    <project.region>US</project.region>
    <argLine>-Duser.timezone=${project.timezone} -Dfile.encoding=${project.build.sourceEncoding} -Duser.language=${project.language} -Duser.region=${project.region}</argLine>
    <skipUnitTests>false</skipUnitTests>

    <!-- sonarcloud properties -->
    <sonar.projectKey>pkiraly_metadata-qa-api</sonar.projectKey>
    <sonar.organization>pkiraly</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jayway.jsonpath</groupId>
      <artifactId>json-path</artifactId>
      <version>2.8.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.12.0</version>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>2.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.7</version>
    </dependency>
    <!-- CSV reader. Docs: http://opencsv.sourceforge.net -->
    <dependency>
      <groupId>com.opencsv</groupId>
      <artifactId>opencsv</artifactId>
      <version>5.7.1</version>
    </dependency>
    <!--
      http://commons.apache.org/proper/commons-text/
      https://mvnrepository.com/artifact/org.apache.commons/commons-text
     -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>1.10.0</version>
    </dependency>
    <!--
      Hierarchical context runner for jUnit
      https://github.com/bechte/junit-hierarchicalcontextrunner/wiki
     -->
    <dependency>
      <groupId>de.bechte.junit</groupId>
      <artifactId>junit-hierarchicalcontextrunner</artifactId>
      <version>4.12.2</version>
      <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/jaxen/jaxen -->
    <dependency>
      <groupId>org.apache.ws.commons</groupId>
      <artifactId>ws-commons-util</artifactId>
      <version>1.0.1</version>
    </dependency>

    <!-- YAML processing -->
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>2.0</version>
    </dependency>
    <!-- command line interface -->
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.5.0</version>
    </dependency>
    <!-- language detection -->
    <dependency>
      <groupId>com.github.pemistahl</groupId>
      <artifactId>lingua</artifactId>
      <version>1.2.2</version>
    </dependency>
    <!-- Solr client -->
    <dependency>
      <artifactId>solr-solrj</artifactId>
      <groupId>org.apache.solr</groupId>
      <version>9.2.1</version>
    </dependency>
    <!-- XML handling https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.15.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.stefanbirkner</groupId>
      <artifactId>system-lambda</artifactId>
      <version>1.2.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.minidev</groupId>
      <artifactId>json-smart</artifactId>
      <version>2.4.10</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <release>11</release>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
            <configuration>
              <skipSource>${skipSource}</skipSource>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <failOnError>false</failOnError>
              <skip>${skipJavadoc}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultEntries>true</addDefaultEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
            </manifest>
          </archive>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <testSource>${maven.compiler.source}</testSource>
          <testTarget>${maven.compiler.target}</testTarget>
          <compilerArgument>
            <arg>-Xlint:unchecked</arg>
          </compilerArgument>
        </configuration>
        <!--
        -->
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
            <configuration>
              <skip>${skipGpg}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
          <skipStaging>${skipStaging}</skipStaging>
        </configuration>
      </plugin>

      <!-- Autogenerated code coverage reports published at
           https://coveralls.io/github/pkiraly/metadata-qa-api -->
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>4.3.0</version>
        <!-- needs for the coverall plugin -->
        <dependencies>
          <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M3</version>
        <configuration>
          <!-- testsToExclude come from the profile-->
          <excludedGroups>${testsToExclude}</excludedGroups>
          <skip>${skipUnitTests}</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.6</version>
        <configuration>
          <destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
          <datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
        </configuration>
        <executions>
          <execution>
            <id>jacoco-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site</id>
            <phase>package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>de.gwdg.metadataqa.api.cli.App</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/version.prop</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>**/version.prop</exclude>
        </excludes>
      </resource>
    </resources>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.2.1</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <configuration>
          <failOnError>false</failOnError>
          <skip>${skipJavadoc}</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>3.3.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.2</version>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>deploy</id>
      <properties>
        <skipSource>false</skipSource>
        <skipGpg>false</skipGpg>
        <skipStaging>false</skipStaging>
        <skipJavadoc>false</skipJavadoc>
      </properties>
      <reporting>
        <excludeDefaults>false</excludeDefaults>
      </reporting>
    </profile>
    <profile>
      <id>travis</id>
      <properties>
        <skipSource>true</skipSource>
        <skipGpg>true</skipGpg>
        <skipStaging>true</skipStaging>
        <skipJavadoc>true</skipJavadoc>
      </properties>
      <reporting>
        <excludeDefaults>true</excludeDefaults>
      </reporting>
    </profile>
  </profiles>
</project>
