<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  pro!vision GmbH
  %%
  Copyright (C) pro!vision GmbH
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->

<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>io.wcm.maven</groupId>
    <artifactId>io.wcm.maven.global-parent</artifactId>
    <version>31</version>
    <relativePath />
  </parent>

  <groupId>de.pro-vision.maven</groupId>
  <artifactId>de.pro-vision.maven.global-parent</artifactId>
  <version>36</version>
  <packaging>pom</packaging>

  <name>de.pro-vision.maven.global-parent</name>
  <description>Global parent for Maven artifact hierarchy. Defines fixed versions of Maven plugins to be used and certain general Maven settings.</description>
  <url>https://github.com/pro-vision/pv-build-tools</url>

  <scm>
    <connection>scm:git:https://github.com/pro-vision/pv-build-tools.git</connection>
    <developerConnection>scm:git:https://github.com/pro-vision/pv-build-tools.git</developerConnection>
    <url>https://github.com/pro-vision/pv-build-tools</url>
    <tag>HEAD</tag>
  </scm>

  <inceptionYear>2012</inceptionYear>

  <organization>
    <name>pro!vision GmbH</name>
    <url>http://www.pro-vision.de</url>
  </organization>

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

  <developers>
    <developer>
      <name>pro!vision GmbH</name>
      <organization>pro!vision GmbH</organization>
      <organizationUrl>http://www.pro-vision.de</organizationUrl>
    </developer>
  </developers>

  <properties>

    <!-- distribution settings -->
    <distribution.snapshotRepositoryId>ossrh</distribution.snapshotRepositoryId>
    <distribution.snapshotRepositoryUrl>https://oss.sonatype.org/content/repositories/snapshots</distribution.snapshotRepositoryUrl>
    <distribution.releaseRepositoryId>ossrh</distribution.releaseRepositoryId>
    <distribution.releaseRepositoryUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2/</distribution.releaseRepositoryUrl>

  </properties>

  <build>
    <extensions>

      <!-- extension for build configuration -->
      <extension>
        <groupId>de.pro-vision.maven</groupId>
        <artifactId>de.pro-vision.maven.build-tools.global-build-tools-mixin</artifactId>
        <version>3</version>
      </extension>

    </extensions>
    <plugins>

      <!-- Site plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>true</skip>
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>

      <!-- gitflow customization (only for this pom) -->
      <plugin>
        <groupId>external.atlassian.jgitflow</groupId>
        <artifactId>jgitflow-maven-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <!-- Prefix release numbers with artifactId for GIT repo with more than one released artifact -->
          <flowInitContext>
            <releaseBranchPrefix>release/${project.artifactId}-</releaseBranchPrefix>
            <hotfixBranchPrefix>hotfix/${project.artifactId}-</hotfixBranchPrefix>
            <versionTagPrefix>${project.artifactId}-</versionTagPrefix>
          </flowInitContext>
        </configuration>
      </plugin>

    </plugins>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>dbunit-maven-plugin</artifactId>
          <version>1.0-beta-2</version>  <!-- beta-3 Version does not work as expected -->
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>sql-maven-plugin</artifactId>
          <version>1.5</version>
        </plugin>

        <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-plugin</artifactId>
          <version>6.1.26</version>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <!-- release-profile -->
    <profile>
      <id>release-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- sign the build (only for this pom, not inherited)  -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- configure staging process at sonatype (only for this pom, not inherited) -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <inherited>false</inherited>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <!-- Deployed artifacts should go to staging to be reviewed before publish -->
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <repository>
      <id>${distribution.releaseRepositoryId}</id>
      <url>${distribution.releaseRepositoryUrl}</url>
    </repository>
    <snapshotRepository>
      <id>${distribution.snapshotRepositoryId}</id>
      <url>${distribution.snapshotRepositoryUrl}</url>
    </snapshotRepository>
  </distributionManagement>

</project>
