<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.reaktivity</groupId>
  <artifactId>nukleus-echo.spec</artifactId>
  <version>0.13</version>
  <name>Echo Nukleus Specification</name>
  <description>Echo Nukleus Specification</description>
  <url>https://github.com/reaktivity/nukleus-echo.spec</url>

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

  <developers>
    <developer>
      <id>reaktivity.org</id>
      <name>The Reaktivity Project Contributors</name>
      <url>http://reaktivity.org/</url>
      <organization>The Reaktivity Project</organization>
      <organizationUrl>http://reaktivity.org/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/reaktivity/nukleus-echo.spec</connection>
    <developerConnection>scm:git:https://github.com/reaktivity/nukleus-echo.spec</developerConnection>
    <url>https://github.com/reaktivity/nukleus-echo.spec</url>
  </scm>

  <properties>
    <maven.compiler.source>9</maven.compiler.source>
    <maven.compiler.target>9</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <checkstyle.config.location>src/conf/checkstyle/configuration.xml</checkstyle.config.location>
    <checkstyle.suppressions.location>src/conf/checkstyle/suppressions.xml</checkstyle.suppressions.location>
    <jacoco.coverage.ratio>1.00</jacoco.coverage.ratio>
    <jacoco.missed.count>0</jacoco.missed.count>

    <junit.version>4.12</junit.version>

    <k3po.version>3.0.0-alpha-104</k3po.version>
    <reaktor.version>0.130</reaktor.version>

    <nukleus.plugin.version>0.46</nukleus.plugin.version>
    <nukleus.spec.version>0.47</nukleus.spec.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.kaazing</groupId>
      <artifactId>k3po.lang</artifactId>
      <version>${k3po.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.reaktivity</groupId>
      <artifactId>nukleus.spec</artifactId>
      <version>${nukleus.spec.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kaazing</groupId>
      <artifactId>k3po.junit</artifactId>
      <version>${k3po.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/scripts</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.reaktivity</groupId>
        <artifactId>nukleus-maven-plugin</artifactId>
        <version>${nukleus.plugin.version}</version>
        <configuration>
          <scopeNames>echo</scopeNames>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>validate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <header>COPYRIGHT</header>
          <properties>
            <copyrightYears>2016-2020</copyrightYears>
          </properties>
          <includes>
            <include>src/**</include>
          </includes>
          <excludes>
            <exclude>src/conf/**</exclude>
          </excludes>
          <mapping>
            <idl>SLASHSTAR_STYLE</idl>
            <rpt>SCRIPT_STYLE</rpt>
          </mapping>
          <failIfUnknown>true</failIfUnknown>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <sourceDirectories>
            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
            <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
          </sourceDirectories>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.29</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.2</version>
        <configuration>
          <rules>
            <rule>
              <element>BUNDLE</element>
              <limits>
                <limit>
                  <counter>INSTRUCTION</counter>
                  <value>COVEREDRATIO</value>
                  <minimum>${jacoco.coverage.ratio}</minimum>
                </limit>
                <limit>
                  <counter>CLASS</counter>
                  <value>MISSEDCOUNT</value>
                  <maximum>${jacoco.missed.count}</maximum>
                </limit>
              </limits>
            </rule>
          </rules>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
          <argLine>@{argLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kaazing</groupId>
        <artifactId>k3po-maven-plugin</artifactId>
        <version>${k3po.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>start</goal>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.reaktivity</groupId>
            <artifactId>reaktor</artifactId>
            <version>${reaktor.version}</version>
            <type>test-jar</type>
          </dependency>
          <dependency>
            <groupId>org.reaktivity</groupId>
            <artifactId>reaktor</artifactId>
            <version>${reaktor.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
          <argLine>@{argLine}</argLine>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</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-enforcer-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <phase>validate</phase>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
