<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.21</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>

  <repositories>
    <repository>
      <id>github</id>
      <url>https://maven.pkg.github.com/reaktivity/packages/</url>
    </repository>
  </repositories>

  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</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.13.1</junit.version>

    <k3po.version>3.1.0</k3po.version>
    <reaktor.version>0.166</reaktor.version>

    <nukleus.plugin.version>0.85</nukleus.plugin.version>
    <nukleus.spec.version>0.58</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-2021</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>
        <groupId>org.jasig.maven</groupId>
        <artifactId>maven-notice-plugin</artifactId>
        <version>1.1.0</version>
        <dependencies>
          <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</version>
          </dependency>
          <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.2.5</version>
          </dependency>
        </dependencies>
        <configuration>
          <includeScopes>compile</includeScopes>
        </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>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </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.6</version>
        <configuration>
          <propertyName>jacoco.java.option</propertyName>
          <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.moditect</groupId>
        <artifactId>moditect-maven-plugin</artifactId>
        <version>1.0.0.RC1</version>
        <configuration>
          <module>
            <moduleInfoFile>src/main/moditect/module-info.java</moduleInfoFile>
          </module>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>add-module-info</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <argLine>@{jacoco.java.option}</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>3.0.0-M4</version>
        <configuration>
          <argLine>@{jacoco.java.option}</argLine>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>maven-notice-plugin</artifactId>
                    <versionRange>[1.1.0,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.moditect</groupId>
                    <artifactId>moditect-maven-plugin</artifactId>
                    <versionRange>[1.0.0.RC1,)</versionRange>
                    <goals>
                      <goal>add-module-info</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>

      <distributionManagement>
        <downloadUrl>https://maven.pkg.github.com/reaktivity/nukleus-echo.spec/</downloadUrl>
        <repository>
          <id>github</id>
          <url>https://maven.pkg.github.com/reaktivity/nukleus-echo.spec/</url>
        </repository>
        <snapshotRepository>
          <id>github</id>
          <url>https://maven.pkg.github.com/reaktivity/nukleus-echo.spec/</url>
        </snapshotRepository>
      </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>
                    <requireJavaVersion>
                      <version>[13,14)</version>
                    </requireJavaVersion>
                  </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-antrun-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>package</phase>
                <configuration>
                  <target>
                    <mkdir dir="${project.build.directory}/apidocs" />
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
              <sourceFileExcludes>
                <exclude>**/internal/**/*.java</exclude>
              </sourceFileExcludes>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>github.packages</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <overWriteReleases>true</overWriteReleases>
              <artifactItems>
                <artifact>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <type>pom</type>
                </artifact>
                <artifact>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                </artifact>
                <artifact>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <classifier>sources</classifier>
                </artifact>
                <artifact>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <classifier>javadoc</classifier>
                </artifact>
              </artifactItems>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>ossrh</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>com.github.genthaler</groupId>
            <artifactId>beanshell-maven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
              <script>
                <![CDATA[
                project.getArtifact().setFile(new java.io.File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar"));
                ]]>
              </script>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
              <artifacts>
                <artifact>
                  <classifier>sources</classifier>
                  <file>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</file>
                </artifact>
                <artifact>
                  <classifier>javadoc</classifier>
                  <file>${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar</file>
                </artifact>
              </artifacts>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </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>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
