<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016 chronicle.software
  ~
  ~ 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>net.openhft</groupId>
        <artifactId>java-parent-pom</artifactId>
        <version>1.1.26</version>
        <relativePath />
    </parent>

    <artifactId>chronicle-queue</artifactId>

    <version>5.22ea2</version>
    <packaging>bundle</packaging>
    <name>OpenHFT/Chronicle-Queue</name>
    <description>Java library for persisted low latency messaging (Java 8+)</description>
    <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>net.openhft</groupId>
                <artifactId>third-party-bom</artifactId>
                <version>3.19.10</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>net.openhft</groupId>
                <artifactId>chronicle-bom</artifactId>
                <version>2.22ea5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>org.openjdk.jol</groupId>
            <artifactId>jol-core</artifactId>
            <version>0.10</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-core</artifactId>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-bytes</artifactId>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-wire</artifactId>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-threads</artifactId>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>affinity</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>jlbh</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- for testing -->
        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-values</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.java</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.6.0</version>
            <scope>test</scope>
        </dependency>

        <!-- for benchmarks -->

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-embedded</artifactId>
            <version>2.13.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>third-party-release</id>
            <name>ThirdParty Repository</name>
            <url>
                https://nexus.chronicle.software/content/repositories/thirdparty/
            </url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>chronicle-enterprise-snapshots</id>
            <name>Snapshot Repository</name>
            <url>
                https://nexus.chronicle.software/content/repositories/snapshots
            </url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>chronicle-enterprise-release</id>
            <url>
                https://nexus.chronicle.software/content/repositories/releases
            </url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <build>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!-- <version>3.0.0-M5</version> Clears Thread.interrupted() -->
                <version>3.0.0-M4</version>
                <configuration>
                    <forkCount>1</forkCount>
<!--                    <reuseForks>false</reuseForks>-->
                    <runOrder>hourly</runOrder>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-publish-plugin</artifactId>
                <configuration>
                    <checkoutDirectory>${project.build.directory}/scmpublish/javadoc
                    </checkoutDirectory>
                    <checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}
                    </checkinComment>
                    <content>${project.reporting.outputDirectory}</content>
                    <skipDeletedFiles>true</skipDeletedFiles>
                    <pubScmUrl>scm:git:git@github.com:OpenHFT/Chronicle-Queue</pubScmUrl>
                    <scmBranch>gh-pages</scmBranch>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}
                        </Bundle-SymbolicName>
                        <Bundle-Name>OpenHFT :: ${project.artifactId}</Bundle-Name>
                        <Export-Package>net.openhft.chronicle.queue.*</Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <!--
                      This execution makes sure that the manifest is available
                      when the tests are executed
                    -->
                    <execution>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>net.openhft</groupId>
                <artifactId>binary-compatibility-enforcer-plugin</artifactId>
                <version>1.0.9</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>enforcer</goal>
                        </goals>
                        <configuration>
                            <referenceVersion>5.21ea1</referenceVersion>
                            <artifactsURI>https://teamcity.chronicle.software/repository/download</artifactsURI>
                            <binaryCompatibilityPercentageRequired>57</binaryCompatibilityPercentageRequired>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/queue.pom.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/queue.pom.properties</exclude>
                </excludes>
            </resource>
        </resources>

    </build>

    <profiles>
        <profile>
            <id>bundled-nexus-staging</id>
            <repositories>
                <repository>
                    <id>chronicle-enterprise-release</id>
                    <url>https://nexus.chronicle.software/content/repositories/releases</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>shade</id>
            <activation>
                <property>
                    <name>build-all</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.2.4</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <shadedArtifactAttached>true</shadedArtifactAttached>
                                    <shadedClassifierName>all</shadedClassifierName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonar</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>run-benchmarks</id>
            <properties />
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <systemProperties>
                                <systemProperty>
                                    <key>jvm.resource.tracing</key>
                                    <value>false</value>
                                </systemProperty>
                            </systemProperties>
                            <classpathScope>test</classpathScope>
                        </configuration>
                        <executions>
                            <execution>
                                <id>ByteArrayJLBHBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.ByteArrayJLBHBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>
                                <id>MethodReaderBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.MethodReaderBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>
                                <id>QueueContendedWritesJLBHBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.QueueContendedWritesJLBHBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>
                                <id>QueueLargeMessageJLBHBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.QueueLargeMessageJLBHBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>
                                <id>QueueMultiThreadedJLBHBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.QueueMultiThreadedJLBHBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>
                                <id>QueueSingleThreadedJLBHBenchmark</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        net.openhft.chronicle.queue.bench.QueueSingleThreadedJLBHBenchmark
                                    </mainClass>
                                </configuration>
                            </execution>
                            <execution>

                            </execution>

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Disable unit tests -->
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <url>scm:git:git@github.com:OpenHFT/Chronicle-Queue.git</url>
        <connection>scm:git:git@github.com:OpenHFT/Chronicle-Queue.git</connection>
        <developerConnection>scm:git:git@github.com:OpenHFT/Chronicle-Queue.git
        </developerConnection>
        <tag>chronicle-queue-5.22ea2</tag>
    </scm>

</project>
