<?xml version="1.0" encoding="UTF-8"?>
<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.rapidpm</groupId>
  <artifactId>rapidpm-functional-reactive</artifactId>
  <version>0.0.5</version>


  <inceptionYear>2017</inceptionYear>
  <organization>
    <name>Functional Reactive</name>
    <url>http://www.functional-reactive.org</url>
  </organization>

  <url>https://github.com/functional-reactive/functional-reactive-lib</url>
  <name>RapidPM Functional Reactive Lib</name>
  <description>Functional Reactive with Core Java</description>
  <scm>
    <url>https://github.com/functional-reactive/functional-reactive-lib</url>
    <connection>scm:git:https://github.com/functional-reactive/functional-reactive-lib.git</connection>
    <developerConnection>scm:git:https://github.com/functional-reactive/functional-reactive-lib.git
    </developerConnection>
    <tag>HEAD</tag>
  </scm>
  <developers>
    <developer>
      <name>Sven Ruppert</name>
      <email>sven.ruppert@gmail.com</email>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>
  <issueManagement>
    <system>Github</system>
    <url>https://github.com/functional-reactive/functional-reactive-lib/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis</system>
    <!--<url>https://build.rapidpm.org/project.html?projectId=RapidPM_RapidPMDependencies</url>-->
  </ciManagement>
  <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>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>


  <properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <jmh.version>1.18</jmh.version>
    <jacoco.version>0.7.9</jacoco.version>

    <!--TDD jUnit5-->
    <junit.version>4.12</junit.version>
    <junit.jupiter.version>5.0.0-RC2</junit.jupiter.version>
    <junit.vintage.version>${junit.version}.0-RC2</junit.vintage.version>
    <junit.platform.version>1.0.0-RC2</junit.platform.version>

  </properties>

  <dependencies>

    <!--TDD-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <!--jUnit5-->

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit.jupiter.version}</version>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
    </dependency>



    <dependency>
      <!--  must be on the classpath  -->
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <classifier>runtime</classifier>
      <version>${jacoco.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.ant</artifactId>
      <version>${jacoco.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.pitest</groupId>
      <artifactId>pitest</artifactId>
      <version>1.2.2</version>
      <scope>test</scope>
    </dependency>

  </dependencies>


  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</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-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <!--<version>0.7.5.201505241946</version>-->
          <version>${jacoco.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-repository-plugin</artifactId>
          <version>2.4</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-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.17</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jdeps-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>1.4.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.3</version>
        </plugin>
        <plugin>
          <groupId>org.pitest</groupId>
          <artifactId>pitest-maven</artifactId>
          <version>1.2.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.4</version>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <!--<goal>jar</goal> do not define it here again !!-->
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
    </repository>
  </repositories>


  <profiles>
    <profile>
      <id>gen-javadoc</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <build>
        <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>
            <configuration>
              <destDir>target/doc/apidoc/</destDir>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>qm-qs-findbugs</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <configuration>
              <onlyAnalyze>org.rapidpm.*</onlyAnalyze>
              <!--
                  Enables analysis which takes more memory but finds more bugs.
                  If you run out of memory, changes the value of the effort element
                  to 'low'.
              -->
              <effort>Max</effort>
              <!-- Reports all bugs (other values are medium and max) -->
              <threshold>Low</threshold>
              <!-- Produces XML report -->
              <xmlOutput>true</xmlOutput>
              <!-- Configures the directory in which the XML report is created -->
              <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
              <!--<visitors>FindDeadLocalStores,UnreadFields</visitors>-->
            </configuration>
          </plugin>
        </plugins>
      </reporting>

    </profile>
    <profile>
      <id>qm-qs-pitest</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <!--Enable mutation testing-->
          <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <configuration>
              <outputFormats>
                <outputFormat>XML</outputFormat>
                <outputFormat>HTML</outputFormat>
              </outputFormats>
              <targetClasses>
                <param>org.rapidpm.*</param>
              </targetClasses>
              <targetTests>
                <param>*.org.rapidpm.*</param>
              </targetTests>
            </configuration>
          </plugin>

        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>report</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>qm-qs-jacoco</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <!--tdd-->
        <dependency>
          <!--  must be on the classpath  -->
          <groupId>org.jacoco</groupId>
          <artifactId>org.jacoco.agent</artifactId>
          <version>${jacoco.version}</version>
          <classifier>runtime</classifier>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.version}</version>
            <configuration>
              <includes>
                <include>**/org/rapidpm/**/*</include>
              </includes>
            </configuration>
            <executions>
              <execution>
                <id>default-instrument</id>
                <goals>
                  <goal>instrument</goal>
                </goals>
              </execution>
              <execution>
                <id>default-restore-instrumented-classes</id>
                <goals>
                  <goal>restore-instrumented-classes</goal>
                </goals>
              </execution>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>default-report</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
              <execution>
                <id>default-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <rules>
                    <rule>
                      <element>BUNDLE</element>
                      <limits>
                        <limit>
                          <counter>COMPLEXITY</counter>
                          <value>COVEREDRATIO</value>
                          <!--<minimum>0.60</minimum>-->
                          <minimum>0.00</minimum>
                        </limit>
                      </limits>
                    </rule>
                    <!--<rule>-->
                    <!--<element>CLASS</element>-->
                    <!--<excludes>-->
                    <!--<exclude>**/junit/**</exclude>-->
                    <!--</excludes>-->
                    <!--<limits>-->
                    <!--<limit>-->
                    <!--<counter>LINE</counter>-->
                    <!--<value>COVEREDRATIO</value>-->
                    <!--<minimum>0.50</minimum>-->
                    <!--</limit>-->
                    <!--</limits>-->
                    <!--</rule>-->
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- Directory plugin to find parent root directory absolute path -->

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

    <profile>
      <id>qm-qs-jacoco-junit</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <systemPropertyVariables>
                <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
              </systemPropertyVariables>
              <includes>
                <include>**/junit/**</include>
              </includes>
              <excludes>
                <exclude>**/*ini/**</exclude>
                <exclude>**/*txt/**</exclude>
                <exclude>**/*.jpg</exclude>

              </excludes>
              <argLine>-Xmx286m -Dsonar.pitest.mode=reuseReport</argLine>

              <forkMode>always</forkMode>

              <threadCount>4</threadCount>
              <reportFormat>xml</reportFormat>
              <reportFormat>html</reportFormat>
              <!--<testSourceDirectory>${project.build.directory}/generated-test-sources/test-annotations</testSourceDirectory>-->
              <!--<classesDirectory>target/generated-classes/emma/classes</classesDirectory>-->
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sys-nexus-deploy</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <distributionManagement>
        <repository>
          <id>sonatype-nexus-snapshots</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>sonatype-nexus-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>

    <profile>
      <id>sys-nexus-deploy-gpg</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>

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

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>qm-qs-checkstyle</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <!-- Check style on build -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
              <execution>
                <id>validate</id>
                <phase>validate</phase>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <!--<excludes>**/generated/**/*</excludes>-->
                  <excludes>**/generated-sources/vwscdn/**/*</excludes>
                  <excludes>**/generated-sources/wscdn/**/*</excludes>
                  <excludes>com/vaadin/**/*,in/virit/**/*,com/acme/**/*</excludes>
                  <checkstyleRules>
                    <module name="Checker">
                      <!--<module name="JavadocPackage"/>-->
                      <!--<module name="NewlineAtEndOfFile"/>-->
                      <module name="FileTabCharacter"/>

                      <module name="RegexpSingleline">
                        <property name="format" value="\s+$"/>
                        <property name="minimum" value="0"/>
                        <property name="maximum" value="0"/>
                        <property name="message" value="Line has trailing spaces."/>
                      </module>

                      <module name="TreeWalker">

                        <!-- Checkstyle has a bug that disallows @return in annotation methods, enable only on demand -->
                        <!--<module name="JavadocMethod"/>-->

                        <!--<module name="JavadocType"/>-->
                        <!--<module name="JavadocVariable"/>-->
                        <!--<module name="JavadocStyle"/>-->

                        <module name="TodoComment"/>

                        <module name="ConstantName"/>
                        <module name="LocalFinalVariableName"/>
                        <module name="LocalVariableName"/>
                        <module name="MemberName"/>
                        <module name="MethodName"/>
                        <module name="PackageName"/>
                        <module name="ParameterName"/>
                        <module name="StaticVariableName"/>
                        <module name="TypeName"/>

                        <module name="IllegalImport"/>
                        <module name="RedundantImport"/>
                        <module name="UnusedImports"/>

                        <module name="EmptyForIteratorPad"/>
                        <module name="GenericWhitespace"/>
                        <module name="MethodParamPad"/>
                        <module name="ParenPad"/>
                        <module name="TypecastParenPad"/>
                        <module name="WhitespaceAfter"/>
                        <module name="WhitespaceAround">
                          <!-- The RCURLY token has strange semantics where annotation arrays should have a spacing while normal
                               arrays should not have such a spacing - therefore, we rather exclude it from automatic checks -->
                          <property name="tokens"
                                    value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
                        </module>
                        <!--<module name="NoWhitespaceAfter"/>-->
                        <!--<module name="NoWhitespaceBefore"/>-->

                        <module name="ModifierOrder"/>

                        <module name="LeftCurly"/>
                        <module name="RightCurly"/>

                        <module name="EmptyStatement"/>
                        <module name="EqualsHashCode"/>
                        <module name="IllegalInstantiation"/>
                        <module name="MissingSwitchDefault"/>
                        <!--<module name="RedundantThrows"/>-->
                        <module name="SimplifyBooleanExpression"/>
                        <module name="SimplifyBooleanReturn"/>

                        <module name="HideUtilityClassConstructor"/>
                        <module name="InterfaceIsType"/>

                        <module name="ArrayTypeStyle"/>
                        <module name="UpperEll"/>
                      </module>
                    </module>

                  </checkstyleRules>
                  <consoleOutput>true</consoleOutput>
                  <failsOnError>true</failsOnError>
                  <encoding>UTF-8</encoding>
                  <outputFileFormat>plain</outputFileFormat>
                  <outputFileFormat>xml</outputFileFormat>
                </configuration>

              </execution>
            </executions>

          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>qm-qs-version-check</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>qm-qs-jdeps</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jdeps-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>jdkinternals</goal> <!-- verify main classes -->
                  <goal>test-jdkinternals</goal> <!-- verify test classes -->
                </goals>
              </execution>
            </executions>
            <configuration>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>