<!--

    Copyright 2019 Telefonaktiebolaget LM Ericsson

    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>
    <groupId>com.ericsson.bss.cassandra.ecaudit</groupId>
    <artifactId>parent_c3.11</artifactId>
    <version>2.8.0</version>
    <packaging>pom</packaging>

    <name>Ericsson Cassandra Audit</name>
    <description>
        A Cassandra audit plug-in for connections attempts and data access
        with support for whitelisting.
    </description>
    <url>https://github.com/ericsson/ecaudit</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <modules>
        <module>test-utils</module>
        <module>common</module>
        <module>ecaudit</module>
        <module>eclog</module>
        <module>integration-test-standard</module>
        <module>integration-test-allow-all-authorizer</module>
        <module>integration-test-query-logger</module>
    </modules>

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

        <cassandra.version>3.11.11</cassandra.version>
        <artifact.flavor.version>c3.11</artifact.flavor.version>

        <pmd-config-url>pmd-rules.xml</pmd-config-url>

        <commons-cli.version>1.4</commons-cli.version>
        <chronicle-queue.version>4.16.5</chronicle-queue.version>

        <assertj.version>3.22.0</assertj.version>
        <cassandra-driver.version>3.6.0</cassandra-driver.version>
        <commons-io.version>2.8.0</commons-io.version>
        <jcip-annotations.version>1.0</jcip-annotations.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>3.12.4</mockito.version>
        <jmh.version>1.27</jmh.version>
        <junitparams.version>1.1.1</junitparams.version>
        <awaitility.version>4.1.1</awaitility.version>
        <equalsverifier.version>3.8.2</equalsverifier.version>

        <com.mycila.license-maven-plugin.version>3.0</com.mycila.license-maven-plugin.version>
        <org.apache.maven.plugins.maven-enforcer-plugin.version>3.0.0-M3</org.apache.maven.plugins.maven-enforcer-plugin.version>
        <org.apache.maven.plugins.maven-compiler-plugin.version>3.8.1</org.apache.maven.plugins.maven-compiler-plugin.version>
        <org.codehaus.mojo.build-helper-maven-plugin.version>1.12</org.codehaus.mojo.build-helper-maven-plugin.version>
        <org.apache.maven.plugins.maven-surefire-plugin.version>2.22.0</org.apache.maven.plugins.maven-surefire-plugin.version>
        <org.apache.maven.plugins.maven-failsafe-plugin.version>2.22.0</org.apache.maven.plugins.maven-failsafe-plugin.version>
        <org.apache.maven.plugins.maven-shade-plugin.version>3.2.4</org.apache.maven.plugins.maven-shade-plugin.version>
        <org.apache.maven.plugins.maven-install-plugin.version>2.5.2</org.apache.maven.plugins.maven-install-plugin.version>
        <org.apache.maven.plugins.maven-release-plugin.version>2.5.3</org.apache.maven.plugins.maven-release-plugin.version>
        <org.apache.maven.plugins.maven-deploy-plugin.version>2.8.2</org.apache.maven.plugins.maven-deploy-plugin.version>
        <org.apache.maven.plugins.maven-source-plugin.version>3.2.1</org.apache.maven.plugins.maven-source-plugin.version>
        <org.apache.maven.plugins.maven-javadoc-plugin.version>3.2.0</org.apache.maven.plugins.maven-javadoc-plugin.version>
        <org.apache.maven.plugins.maven-gpg-plugin.version>1.6</org.apache.maven.plugins.maven-gpg-plugin.version>
        <org.jacoco.jacoco-maven-plugin.version>0.8.6</org.jacoco.jacoco-maven-plugin.version>
        <org.pitest.pitest-maven.version>1.6.2</org.pitest.pitest-maven.version>
        <org.apache.maven.plugins-maven-pmd-plugin.version>3.14.0</org.apache.maven.plugins-maven-pmd-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.cassandra</groupId>
                <artifactId>cassandra-all</artifactId>
                <version>${cassandra.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.cassandra</groupId>
                <artifactId>cassandra-thrift</artifactId>
                <version>${cassandra.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>${commons-cli.version}</version>
            </dependency>
            <dependency>
                <groupId>net.openhft</groupId>
                <artifactId>chronicle-queue</artifactId>
                <version>${chronicle-queue.version}</version>
            </dependency>
            <!-- Test dependencies -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.datastax.cassandra</groupId>
                <artifactId>cassandra-driver-core</artifactId>
                <version>${cassandra-driver.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.jcip</groupId>
                <artifactId>jcip-annotations</artifactId>
                <version>${jcip-annotations.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>pl.pragmatists</groupId>
                <artifactId>JUnitParams</artifactId>
                <version>${junitparams.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>${equalsverifier.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${org.codehaus.mojo.build-helper-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-surefire-plugin.version}</version>
                    <executions>
                        <execution />
                    </executions>
                    <configuration>
                        <excludes>
                            <exclude>com.ericsson.bss.cassandra.ecaudit.integration.*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${org.pitest.pitest-maven.version}</version>
                    <configuration>
                        <timestampedReports>false</timestampedReports>
                         <mutators>
                            <mutator>DEFAULTS</mutator>
                            <mutator>EXPERIMENTAL_NAKED_RECEIVER</mutator>
                        </mutators>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${org.apache.maven.plugins-maven-pmd-plugin.version}</version>
                    <configuration>
                        <rulesets>
                            <ruleset>${pmd-config-url}</ruleset>
                        </rulesets>
                        <printFailingErrors>true</printFailingErrors>
                        <linkXRef>false</linkXRef>
                        <excludes>
                            <exclude>com/ericsson/bss/cassandra/ecaudit/auth/cache/</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${com.mycila.license-maven-plugin.version}</version>
                    <configuration>
                        <inlineHeader><![CDATA[
Copyright YEAR Telefonaktiebolaget LM Ericsson

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.
]]>
                        </inlineHeader>
                        <headerSections>
                            <headerSection>
                                <key>YEAR</key>
                                <defaultValue>2019</defaultValue>
                                <ensureMatch>[0-9-]+</ensureMatch>
                            </headerSection>
                        </headerSections>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                        <strictCheck>true</strictCheck>
                        <failIfUnknown>true</failIfUnknown>
                        <excludes>
                            <exclude>LICENSE</exclude>
                            <exclude>NOTICE</exclude>
                            <exclude>.github/**</exclude>
                            <exclude>doc/ecaudit-performance.html</exclude>
                            <exclude>src/main/java/com/ericsson/bss/cassandra/ecaudit/auth/cache/**.java</exclude>
                            <exclude>src/test/resources/cassandra.yaml</exclude>
                            <exclude>src/test/resources/cassandra-rackdc.properties</exclude>
                            <exclude>src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker</exclude>
                            <exclude>**/pom.xml.tag</exclude>
                            <exclude>**/pom.xml.releaseBackup</exclude>
                            <exclude>release.properties</exclude>
                            <exclude>**/*.cq4</exclude>
                            <exclude>**/directory-listing.cq4t</exclude>
                            <exclude>${pmd-config-url}</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-shade-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${org.apache.maven.plugins.maven-release-plugin.version}</version>
                    <configuration>
                        <tagNameFormat>ecaudit_${artifact.flavor.version}-@{project.version}</tagNameFormat>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${org.apache.maven.plugins.maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.5.2,4.0)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${org.jacoco.jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>${org.apache.maven.plugins-maven-pmd-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>pmd-check</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>check</goal>
                                    <goal>cpd-check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>${com.mycila.license-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>license-check</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>javadoc</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                                <configuration>
                                    <quiet>true</quiet>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>github</id>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${org.apache.maven.plugins.maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <quiet>true</quiet>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${org.apache.maven.plugins.maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <url>https://github.com/ericsson/ecaudit</url>
        <connection>scm:git:git@github.com:ericsson/ecaudit.git</connection>
        <developerConnection>scm:git:git@github.com:ericsson/ecaudit.git</developerConnection>
        <tag>ecaudit_c3.11-2.8.0</tag>
    </scm>

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

    <organization>
        <name>Ericsson AB</name>
        <url>http://www.ericsson.com</url>
    </organization>

    <developers>
        <developer>
            <name>Per Otterström</name>
            <email>per.otterstrom@gmail.com</email>
        </developer>
        <developer>
            <name>Tobias Eriksson</name>
            <email>tti.eriksson@gmail.com</email>
        </developer>
        <developer>
            <name>Laxmikant Upadhyay</name>
            <email>laxmikant.hcl@gmail.com</email>
        </developer>
        <developer>
            <name>Anuj Wadhera</name>
            <email>anuj.wadhera@ericsson.com</email>
            <organization>Ericsson AB</organization>
            <organizationUrl>http://www.ericsson.com</organizationUrl>
        </developer>
        <developer>
            <name>Marcus Olsson</name>
            <email>marcus.olsson@ericsson.com</email>
            <organization>Ericsson AB</organization>
            <organizationUrl>http://www.ericsson.com</organizationUrl>
        </developer>
        <developer>
            <name>Ted Petersson</name>
        </developer>
        <developer>
            <name>Pushpendra Rajpoot</name>
            <email>pushpendra.rajpoot@ericsson.com</email>
            <organization>Ericsson AB</organization>
            <organizationUrl>http://www.ericsson.com</organizationUrl>
        </developer>
    </developers>
</project>
