<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Indoqa Software Design und Beratung GmbH (Indoqa) under
  one or more contributor license agreements. See the NOTICE file distributed
  with this work for additional information regarding copyright ownership.
  Indoqa licenses this file to You 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.
-->
<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>
  <packaging>pom</packaging>

  <groupId>com.indoqa</groupId>
  <artifactId>indoqa-oss-parent</artifactId>
  <version>5</version>

  <name>Indoqa OSS Parent</name>
  <url>https://github.com/indoqa/</url>
  <description>The Maven Parent POM for Indoqa opensource software.</description>

  <organization>
    <name>Indoqa Software Design und Beratung GmbH</name>
    <url>https://www.indoqa.com</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:Indoqa/indoqa-oss-parent.git</connection>
    <developerConnection>scm:git:git@github.com:Indoqa/indoqa-oss-parent.git</developerConnection>
    <url>https://github.com/Indoqa/indoqa-oss-parent</url>
    <tag>indoqa-oss-parent-5</tag>
  </scm>

 <developers>
    <developer>
      <name>Steven Dolg</name>
      <email>steven.dolg@indoqa.com</email>
      <organization>Indoqa Software Design und Beratung GmbH</organization>
      <organizationUrl>http://www.indoqa.com</organizationUrl>
    </developer>
    <developer>
      <name>Alexander Eibner</name>
      <email>alexander.eibner@indoqa.com</email>
      <organization>Indoqa Software Design und Beratung GmbH</organization>
      <organizationUrl>http://www.indoqa.com</organizationUrl>
    </developer>
    <developer>
      <name>Matthias Epheser</name>
      <email>matthias.epheser@indoqa.com</email>
      <organization>Indoqa Software Design und Beratung GmbH</organization>
      <organizationUrl>http://www.indoqa.com</organizationUrl>
    </developer>
    <developer>
      <name>Reinhard Pötz</name>
      <email>reinhard.poetz@indoqa.com</email>
      <organization>Indoqa Software Design und Beratung GmbH</organization>
      <organizationUrl>http://www.indoqa.com</organizationUrl>
    </developer>
  </developers>
  
  <distributionManagement>
    <snapshotRepository>
      <id>oss-sonatype-releases</id>
      <name>Sonatype Nexus Snapshots Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>oss-sonatype-releases</id>
      <name>Sonatype Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>  

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.compiler.version>1.8</project.build.compiler.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.license.rootDir>${basedir}</project.license.rootDir>
    <maven.compiler.target>${project.build.compiler.version}</maven.compiler.target>
    <forbiddenapis.skip>false</forbiddenapis.skip>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <downloadSources>true</downloadSources>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.indoqa</groupId>
        <artifactId>cycle-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>analyze</goal>
            </goals>
          </execution>
        </executions>          
      </plugin>      
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <configuration>
          <failOnUnsupportedJava>false</failOnUnsupportedJava>
          <failOnUnresolvableSignatures>false</failOnUnresolvableSignatures>
          <bundledSignatures>
            <bundledSignature>jdk-non-portable</bundledSignature>
            <bundledSignature>jdk-unsafe</bundledSignature>
            <bundledSignature>jdk-deprecated</bundledSignature>
            <bundledSignature>jdk-system-out</bundledSignature>
            <bundledSignature>jdk-internal</bundledSignature>
            <!--
            <bundledSignature>jdk-reflection</bundledSignature>
            <bundledSignature>commons-io-unsafe-2.5</bundledSignature>
            -->
          </bundledSignatures>
          <skip>${forbiddenapis.skip}</skip>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
              <goal>testCheck</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- specific -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/bin/*</exclude>
            <exclude>README.md</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>     
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.10</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <version>9.4.6.v20170531</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <arguments>${arguments} -Pindoqa-release,indoqa-tests,indoqa-oss-release</arguments>
            <goals>deploy</goals>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.12</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
          <configuration>
            <source>${project.build.compiler.version}</source>
            <target>${project.build.compiler.version}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.5</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
          <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.6.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.20</version>
          <configuration>
            <argLine>${argLine}</argLine>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.20</version>
          <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>de.thetaphi</groupId>
          <artifactId>forbiddenapis</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>3.0.1</version>
          <extensions>true</extensions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <extensions>true</extensions>
          <configuration>
            <serverId>oss-sonatype-releases</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>false</autoReleaseAfterClose>
          </configuration>
        </plugin>
        <!-- specific -->
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.11</version>
        </plugin>    
        <plugin>
          <groupId>de.jutzig</groupId>
          <artifactId>github-release-plugin</artifactId>
          <version>1.1.1</version>
        </plugin>      
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.7.9</version>
        </plugin>
        <!-- Indoqa plugins -->
        <plugin>
          <groupId>com.indoqa</groupId>
          <artifactId>cycle-maven-plugin</artifactId>
          <version>2.0.0</version>         
        </plugin>          
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>indoqa-oss-release</id>
      <build>
        <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-resource</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>add-resource</goal>
                </goals>
                <configuration>
                  <resources>
                    <resource>
                      <directory>${project.license.rootDir}</directory>
                      <targetPath>META-INF</targetPath>
                      <includes>
                        <include>LICENSE</include>
                        <include>NOTICE</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-resources-javadoc</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/apidocs/META-INF</outputDirectory>
                  <resources>
                    <resource>
                      <!-- Do not forget to include files also for jar and sources jar -->
                      <directory>${project.license.rootDir}</directory>
                      <include>NOTICE</include>
                      <include>LICENSE</include>
                    </resource>
                  </resources>
                </configuration> 
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </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>test-coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.9</version>
            <configuration>
              <destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
              <datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
            </configuration>        
            <executions>
              <execution>
                <id>default-prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>default-report</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>           
        </plugins>
      </build>
    </profile>    
  </profiles>
</project>
