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

Copyright (c) 2000-2018, Board of Trustees of Leland Stanford Jr. University
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form 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.

3. Neither the name of the copyright holder 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 HOLDER 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  
  <groupId>org.lockss</groupId>
  <artifactId>lockss-parent-pom</artifactId>
  <version>1.4.0</version>
  <packaging>pom</packaging>
  
  <name>lockss-parent-pom</name>
  <description>Maven infrastructure common to most LOCKSS projects</description>
  <url>https://www.lockss.org/</url>
  <inceptionYear>2000</inceptionYear>
  
  <organization>
    <name>LOCKSS Program</name>
    <url>https://www.lockss.org/</url>
  </organization>
  
  <licenses>
    <license>
      <name>3-Clause BSD License</name>
      <url>https://opensource.org/licenses/BSD-3-Clause</url>
    </license>
  </licenses>
  
  <!--
      For each developer alphabetically by last name:
      - <id> is the GitHub username
      - <email> is the GPG e-mail address
      There is also a parallel <contributors> stanza
  -->
  <developers>
    <developer>
      <id>fergaloy</id>
      <name>Fernando García-Loygorri</name>
      <email>fergaloy@lockss.org</email>
      <organization>LOCKSS Program</organization>
      <organizationUrl>https://www.lockss.org/</organizationUrl>
    </developer>
    <developer>
      <id>clairegriffin</id>
      <name>Claire Griffin</name>
      <email>clairetg@stanford.edu</email>
      <organization>LOCKSS Program</organization>
      <organizationUrl>https://www.lockss.org/</organizationUrl>
    </developer>
    <developer>
      <id>thibgc</id>
      <name>Thib Guicherd-Callin</name>
      <email>thib@cs.stanford.edu</email>
      <organization>LOCKSS Program</organization>
      <organizationUrl>https://www.lockss.org/</organizationUrl>
    </developer>
    <developer>
      <id>tlipkis</id>
      <name>Tom Lipkis</name>
      <email>tal@lockss.org</email>
      <organization>LOCKSS Program</organization>
      <organizationUrl>https://www.lockss.org/</organizationUrl>
    </developer>
    <developer>
      <id>dlvargas</id>
      <name>Daniel Vargas</name>
      <email>dlvargas@stanford.edu</email>
      <organization>LOCKSS Program</organization>
      <organizationUrl>https://www.lockss.org/</organizationUrl>
    </developer>
  </developers>

  <!-- This stanza needs to be repeated in every child -->
  <scm>
    <connection>${scmConnection}</connection>
    <developerConnection>${scmDeveloperConnection}</developerConnection>
    <url>${scmUrl}</url>
  </scm>
  
  <distributionManagement>

    <!--  To deploy to Maven Central; see http://central.sonatype.org/pages/apache-maven.html  -->
    <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>

    <!-- Java related -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <test.fork.count>1.0C</test.fork.count>
    
    <!-- Git related -->
    <gitSshUsername>git</gitSshUsername>
    <gitHost>github.com</gitHost>
    <gitGroupId>lockss</gitGroupId>
    <gitProjectId>${project.artifactId}</gitProjectId>
    <scmConnection>scm:git:git://${gitHost}/${gitGroupId}/${gitProjectId}.git</scmConnection>
    <scmDeveloperConnection>scm:git:${gitSshUsername}@${gitHost}:${gitGroupId}/${gitProjectId}.git</scmDeveloperConnection>
    <scmUrl>https://${gitHost}/${gitGroupId}/${gitProjectId}</scmUrl>

    <!-- Our own -->
    <skipTests>false</skipTests>
    <skipIntegrationTests>true</skipIntegrationTests>
    <loglevel>info</loglevel>
    <outputtofile>true</outputtofile>
    <trimstack>false</trimstack>

  </properties>

  <build>
  
    <plugins>
    
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.21.0</version>
        <configuration>
          <skipTests>${skipTests}</skipTests>
          <includes>
            <include>**/Test*.java</include>
            <include>**/Func*.java</include>
          </includes>
          <excludes>
	    <!-- SOAP tests waiting for Jetty upgrade -->
            <exclude>**/ws/*/Func*.java</exclude>
	    <!-- Default excludes -->
	    <exclude>**/*$*</exclude>
          </excludes>
          <redirectTestOutputToFile>${outputtofile}</redirectTestOutputToFile>
          <forkCount>${test.fork.count}</forkCount>
          <reuseForks>false</reuseForks>
	  <trimStackTrace>${trimstack}</trimStackTrace>
          <systemPropertyVariables>
            <org.lockss.unitTesting>true</org.lockss.unitTesting>
            <org.lockss.defaultLogLevel>${loglevel}</org.lockss.defaultLogLevel>
            <org.lockss.defaultLogTarget>org.lockss.util.StdErrTarget</org.lockss.defaultLogTarget>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <!-- For useIncrementalCompilation=false -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <useIncrementalCompilation>false</useIncrementalCompilation>
        </configuration>
      </plugin>

    </plugins>
  
  </build>
  
  <profiles>
  
    <profile>
      <id>lockss-release</id>

      <build>
      
        <plugins>
      
          <!--  To deploy to Maven Central; see http://central.sonatype.org/pages/apache-maven.html  -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          
          <!--  To deploy GPG-signed components to Maven Central; see http://central.sonatype.org/pages/apache-maven.html -->
          <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>
              </execution>
            </executions>
          </plugin>
        
          <!--  To deploy Source JARs to Maven Central; see http://central.sonatype.org/pages/apache-maven.html -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        
          <!--  To deploy Javadoc JARS to Maven Central; see http://central.sonatype.org/pages/apache-maven.html -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
	    <configuration>
	      <doclint>none</doclint>
	    </configuration>
          </plugin>

        </plugins>
    
      </build>
    
    </profile>
  
  </profiles>
  
</project>
