<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2016 Gridtec. All rights reserved.

  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.
  -->
<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>9</version>
    </parent>

    <groupId>at.gridtec.lambda4j</groupId>
    <artifactId>lambda4j-parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <name>Lambda4j Project</name>
    <url>https://github.com/gridtec/lambda4j</url>
    <description>Lambda4j provides non-throwable and throwable Java 8 functional interfaces (lambdas).</description>
    <inceptionYear>2015</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <organization>
        <name>Gridtec</name>
        <url>http://www.gridtec.at</url>
    </organization>
    <developers>
        <developer>
            <id>djessich</id>
            <name>Dominik Jessich</name>
            <email>jessich.dominik@gridtec.at</email>
            <url>https://github.com/djessich</url>
            <organization>Gridtec</organization>
            <organizationUrl>http://www.gridtec.at</organizationUrl>
        </developer>
    </developers>

    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>

    <scm>
        <connection>scm:git:git@github.com:gridtec/lambda4j.git</connection>
        <developerConnection>scm:git:git@github.com:gridtec/lambda4j.git</developerConnection>
        <url>https://github.com/gridtec/lambda4j</url>
        <tag>v1.0.0</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/gridtec/lambda4j/issues</url>
    </issueManagement>

    <modules>
        <module>lambda4j</module>
        <module>lambda4j-core</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven.version>3.0.3</maven.version>
        <maven.compiler.version>3.3</maven.compiler.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.eclipse.version>2.10</maven.eclipse.version>
        <maven.idea.version>2.2.1</maven.idea.version>
        <maven.source.version>2.4</maven.source.version>
        <maven.javadoc.version>2.10.2</maven.javadoc.version>
        <maven.javadoc.sourceEncoding>${project.build.sourceEncoding}</maven.javadoc.sourceEncoding>
        <maven.clean.version>3.0.0</maven.clean.version>
        <maven.surefire.version>2.19</maven.surefire.version>
        <maven.enforcer.version>1.4.1</maven.enforcer.version>
        <maven.site.version>3.4</maven.site.version>
        <maven.rat.version>0.11</maven.rat.version>
        <maven.release.version>2.5.1</maven.release.version>
        <maven.deploy.version>2.8.2</maven.deploy.version>
        <maven.build-helper.version>1.10</maven.build-helper.version>
        <maven.findbugs.version>3.0.3</maven.findbugs.version>
        <maven.surefire.version>2.19</maven.surefire.version>
        <maven.gpg.version>1.6</maven.gpg.version>
        <extra.source.main>${project.basedir}/src-gen/main/java</extra.source.main>
        <extra.source.test>${project.basedir}/src-gen/test/java</extra.source.test>
        <testng.version>6.1.1</testng.version>
        <jsr305.version>3.0.0</jsr305.version>
        <commons.lang3.version>3.4</commons.lang3.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>at.gridtec.lambda4j</groupId>
                <artifactId>lambda4j-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>at.gridtec.lambda4j</groupId>
                <artifactId>lambda4j-functions</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr305.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang3.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.version}</version>
                    <configuration>
                        <links>
                            <link>https://docs.oracle.com/javase/8/docs/api/</link>
                            <link>https://commons.apache.org/proper/commons-lang/javadocs/api-release/</link>
                        </links>
                        <tags>
                            <tag>
                                <name>apiNote</name>
                                <placement>a</placement>
                                <head>API Note:</head>
                            </tag>
                            <tag>
                                <name>implSpec</name>
                                <placement>a</placement>
                                <head>Implementation Requirements:</head>
                            </tag>
                            <tag>
                                <name>implNote</name>
                                <placement>a</placement>
                                <head>Implementation Note:</head>
                            </tag>
                        </tags>
                        <encoding>${maven.javadoc.sourceEncoding}</encoding>
                        <docencoding>${maven.javadoc.sourceEncoding}</docencoding>
                        <charset>${maven.javadoc.sourceEncoding}</charset>
                        <windowtitle>${project.name} ${project.version} API Specification</windowtitle>
                        <doctitle>${project.name} ${project.version} API Specification</doctitle>
                        <testWindowtitle>${project.name} ${project.version} API Tests</testWindowtitle>
                        <testDoctitle>${project.name} ${project.version} API Tests</testDoctitle>
                        <header>${project.name}</header>
                        <author>false</author>
                        <notimestamp>true</notimestamp>
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven.clean.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer.version}</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>[${maven.version},)</version>
                            </requireMavenVersion>
                            <requireJavaVersion>
                                <version>[1.8,)</version>
                            </requireJavaVersion>
                        </rules>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven.site.version}</version>
                    <executions>
                        <execution>
                            <id>attach-descriptor</id>
                            <goals>
                                <goal>attach-descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven.release.version}</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <useReleaseProfile>false</useReleaseProfile>
                        <arguments>${arguments} -Psonatype-oss-release</arguments>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${maven.build-helper.version}</version>
                    <executions>
                        <execution>
                            <id>add-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${extra.source.main}</source>
                                </sources>
                            </configuration>
                        </execution>
                        <execution>
                            <id>add-test-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${extra.source.test}</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${maven.findbugs.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-idea-plugin</artifactId>
                <version>${maven.idea.version}</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>${maven.eclipse.version}</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>${maven.rat.version}</version>
                <configuration>
                    <excludes>
                        <exclude>.git/**</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>.idea/**</exclude>
                        <exclude>CHANGES</exclude>
                        <exclude>CONTRIBUTING</exclude>
                        <exclude>CONTRIBUTORS.md</exclude>
                        <exclude>README.md</exclude>
                        <exclude>**/*.iml</exclude>
                        <exclude>lambda4j-generator/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${maven.findbugs.version}</version>
                <configuration>
                    <!-- increase the maximum allowed heap size (default is 768M) to 1024M, as it will fail -->
                    <maxHeap>1024</maxHeap>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!-- shows all compiler warnings -->
        <profile>
            <id>show-compiler-warnings</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <compilerArgument>-Xlint:all</compilerArgument>
                                <showWarnings>true</showWarnings>
                                <showDeprecation>true</showDeprecation>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>sources</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <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>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>javadoc</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <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>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <!-- disables strict javadoc for Java 8 -->
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <additionalparam>-Xdoclint:none</additionalparam>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <!-- disables tests in reactor build -->
        <profile>
            <id>disable-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- signs all artifacts when performing release (signed artifacts are required by maven central) -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- adds the generator to reactor build -->
        <!-- if the "run-generator" profile is also active, the generator module gets added to the reactor build once -->
        <profile>
            <id>include-generator</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>lambda4j-generator</module>
            </modules>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>at.gridtec.lambda4j</groupId>
                        <artifactId>lambda4j-generator</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </dependencyManagement>
        </profile>
        <!-- adds the generator to reactor build and runs the generator (override this profile in modules which need to run the generator) -->
        <!-- if the "include-generator" profile is also active, the generator module gets added to the reactor build once -->
        <profile>
            <id>run-generator</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>lambda4j-generator</module>
            </modules>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>at.gridtec.lambda4j</groupId>
                        <artifactId>lambda4j-generator</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </dependencyManagement>
        </profile>
    </profiles>
</project>
