<!--

    This file is part of veraPDF Consortium parent, a module of the veraPDF project.
    Copyright (c) 2015, veraPDF Consortium <info@verapdf.org>
    All rights reserved.

    veraPDF Consortium parent is free software: you can redistribute it and/or modify
    it under the terms of either:

    The GNU General public license GPLv3+.
    You should have received a copy of the GNU General Public License
    along with veraPDF Consortium parent as the LICENSE.GPL file in the root of the source
    tree.  If not, see http://www.gnu.org/licenses/ or
    https://www.gnu.org/licenses/gpl-3.0.en.html.

    The Mozilla Public License MPLv2+.
    You should have received a copy of the Mozilla Public License along with
    veraPDF Consortium parent as the LICENSE.MPL file in the root of the source tree.
    If a copy of the MPL was not distributed with this file, you can obtain one at
    http://mozilla.org/MPL/2.0/.

-->
<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>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
    <relativePath/>
  </parent>

  <groupId>org.verapdf</groupId>
  <artifactId>verapdf-parent</artifactId>
  <version>1.24.1</version>
  <packaging>pom</packaging>

  <name>veraPDF Consortium parent </name>
  <description>Organisation details and project wide build tools and dependency management.</description>

  <inceptionYear>2015</inceptionYear>
  <organization>
    <name>The veraPDF Consortium</name>
    <url>http://www.verapdf.org/</url>
  </organization>
  <licenses>
    <license>
      <name>GNU General Public License, version 3 (GPL-3.0)</name>
      <url>http://opensource.org/licenses/GPL-3.0</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>Mozilla Public License 2.0 (MPL-2.0)</name>
      <url>http://opensource.org/licenses/MPL-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <email>maksim.bezrukov@duallab.com</email>
      <name>Maksim Bezrukov</name>
      <url>https://github.com/BezrukovM</url>
      <organization>Dual Lab</organization>
      <organizationUrl>http://www.duallab.com/</organizationUrl>
      <id>BezrukovM</id>
    </developer>
    <developer>
      <email>boris.dubrov@duallab.com</email>
      <name>Boris Dubrov</name>
      <url>https://github.com/bdoubrov</url>
      <organization>Dual Lab</organization>
      <organizationUrl>http://www.duallab.com/</organizationUrl>
      <id>bdoubrov</id>
    </developer>
    <developer>
      <email>timur.kamalov@duallab.com</email>
      <name>Timur Kamalov</name>
      <url>https://github.com/timurkamalov</url>
      <organization>Dual Lab</organization>
      <organizationUrl>http://www.duallab.com/</organizationUrl>
      <id>timurkamalov</id>
    </developer>
    <developer>
      <email>dmitry.remezow@duallab.com</email>
      <name>Dmitry Remezow</name>
      <url>https://github.com/DmitryRemezow</url>
      <organization>Dual Lab</organization>
      <organizationUrl>http://www.duallab.com/</organizationUrl>
      <id>DmitryRemezow</id>
    </developer>
    <developer>
      <email>sergey.shemyakov@duallab.com</email>
      <name>Sergey Shemyakov</name>
      <url>https://github.com/shem-sergey</url>
      <organization>Dual Lab</organization>
      <organizationUrl>http://www.duallab.com/</organizationUrl>
      <id>shem-sergey</id>
    </developer>
    <developer>
      <email>carl@openpreservation.org</email>
      <name>Carl Wilson</name>
      <url>https://github.com/carlwilson</url>
      <organization>Open Preservation Foundation</organization>
      <organizationUrl>http://openpreservation.org</organizationUrl>
      <id>carlwilson</id>
    </developer>
  </developers>

  <issueManagement>
    <url>https://github.com/veraPDF/veraPDF-library/issues/</url>
    <system>GitHub Issues</system>
  </issueManagement>
  <ciManagement>
    <system>OPF Jenkins</system>
    <url>http://jenkins.opf-labs.org</url>
  </ciManagement>

  <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>

  <repositories>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>vera-dev</id>
      <name>Vera development</name>
      <url>https://artifactory.openpreservation.org/artifactory/vera-dev</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>vera-dev</id>
      <name>Vera development</name>
      <url>https://artifactory.openpreservation.org/artifactory/vera-dev</url>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
    <mvn.assembly.version>3.1.1</mvn.assembly.version>
    <mvn.clean.version>3.1.0</mvn.clean.version>
    <mvn.compiler.version>3.8.1</mvn.compiler.version>
    <mvn.deploy.version>3.0.0-M1</mvn.deploy.version>
    <mvn.enforcer.version>1.3.1</mvn.enforcer.version>
    <mvn.exec.version>1.4.0</mvn.exec.version>
    <mvn.gpg.plugin.version>1.6</mvn.gpg.plugin.version>
    <mvn.javadoc.version>3.1.0</mvn.javadoc.version>
    <mvn.project-info.version>2.9</mvn.project-info.version>
    <mvn.release.version>2.5.3</mvn.release.version>
    <mvn.resources.version>3.1.0</mvn.resources.version>
    <mvn.site.version>3.6</mvn.site.version>
    <mvn.source.version>3.1.0</mvn.source.version>
    <mvn.surefire.version>3.0.0-M3</mvn.surefire.version>
    <mvn.versions.version>2.7</mvn.versions.version>
    <mvn.mycilla.license.version>3.0</mvn.mycilla.license.version>
    <verapdf.timestamp>${maven.build.timestamp}</verapdf.timestamp>
  </properties>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${mvn.mycilla.license.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${mvn.assembly.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${mvn.clean.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${mvn.compiler.version}</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${mvn.deploy.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${mvn.gpg.plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${mvn.javadoc.version}</version>
          <executions>
            <execution>
              <id>attach-javadoc</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <failOnError>false</failOnError>
                <dependencySourceExcludes>
                  <!-- exclude ONLY commons-cli artifacts -->
                  <dependencySourceExclude>junit:*</dependencySourceExclude>
                  <dependencySourceExclude>org.apache:*</dependencySourceExclude>
                  <dependencySourceExclude>org.junit:*</dependencySourceExclude>
                  <dependencySourceExclude>org.hamcrest.*</dependencySourceExclude>
                  <dependencySourceExclude>org.log4j.*</dependencySourceExclude>
                </dependencySourceExcludes>
                <includeDependencySources>true</includeDependencySources>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${mvn.release.version}</version>
          <configuration>
            <preparationGoals>clean install</preparationGoals>
            <goals>deploy</goals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${mvn.resources.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${mvn.site.version}</version>
          <configuration>
            <attach>true</attach>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${mvn.source.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${mvn.project-info.version}</version>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.7</version>
          <executions>
            <execution>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>report</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${mvn.surefire.version}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${mvn.versions.version}</version>
        </plugin>

      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <inherited>true</inherited>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${mvn.enforcer.version}</version>
          <executions>
            <execution>
              <id>enforce-maven-3</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>3.0</version>
                  </requireMavenVersion>
                </rules>
                <fail>true</fail>
              </configuration>
            </execution>
         </executions>
       </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.sonar-plugins.java</groupId>
      <artifactId>sonar-jacoco-listeners</artifactId>
      <version>3.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>license-header</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <header>license/template/license.txt</header>
              <properties>
                <owner>veraPDF Consortium</owner>
                <email>info@verapdf.org</email>
              </properties>
              <excludes>
                <exclude>license/template/**</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <phase>prepare-package</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>coverage-per-test</id>
      <build>
        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>

              <properties>
                <property>
                  <name>listener</name>
                  <value>org.sonar.java.jacoco.JUnitListener</value>
                </property>
              </properties>

              <excludes>
                <exclude>**/*IT.java</exclude>
              </excludes>

            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
              <preparationGoals>clean install</preparationGoals>
              <goals>deploy</goals>
              <autoVersionSubmodules>true</autoVersionSubmodules>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </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>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>ossrh</id>
      <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>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <executions>
              <execution>
                <id>sign</id>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>verapdf</id>
      <distributionManagement>
        <snapshotRepository>
          <id>opf-artefactory</id>
          <url>https://artifactory.openpreservation.org/artifactory/vera-dev-local/</url>
        </snapshotRepository>
        <repository>
          <id>opf-artefactory</id>
          <url>https://artifactory.openpreservation.org/artifactory/vera-dev-local/</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <id>jenkins-site</id>
      <distributionManagement>
        <site>
          <id>jenkins.local.site</id>
          <name>veraPDF Site</name>
          <url>file:///var/www/projects.verapdf.org/${project.artifactId}</url>
        </site>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>
