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

    <parent>
        <groupId>org.graylog.plugins</groupId>
        <artifactId>graylog-plugin-web-parent</artifactId>
        <version>3.3.6</version>
    </parent>

    <groupId>com.airbus-cyber-security.graylog</groupId>
    <artifactId>graylog-plugin-aggregation-count</artifactId>
    <version>2.2.1</version>
    <packaging>jar</packaging>

    <name>${project.artifactId}</name>
    <description>Graylog ${project.artifactId} plugin.</description>
    <url>https://github.com/airbus-cyber/graylog-plugin-aggregation-count</url>

    <licenses>
        <license>
            <name>GNU General Public License (GPL) version 3.0</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Airbus CyberSecurity</name>
            <organization>Airbus CyberSecurity</organization>
            <organizationUrl>https://www.airbus-cyber-security.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:airbus-cyber/graylog-plugin-aggregation-count.git</connection>
        <developerConnection>scm:git:git@github.com:airbus-cyber/graylog-plugin-aggregation-count.git</developerConnection>
        <url>https://github.com/airbus-cyber/graylog-plugin-aggregation-count</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <name>Nexus Release Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <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>
        <graylog.version>3.2.5</graylog.version>
        <graylog2.plugin-dir>/usr/share/graylog-server/plugin</graylog2.plugin-dir>

        <!-- Test dependencies -->
        <apacheds-server.version>2.0.0-M24</apacheds-server.version>
        <assertj-core.version>3.9.1</assertj-core.version>
        <assertj-joda-time.version>2.0.0</assertj-joda-time.version>
        <awaitility.version>1.7.0</awaitility.version>
        <equalsverifier.version>2.3.3</equalsverifier.version>
        <fongo.version>2.1.0</fongo.version>
        <jukito.version>1.5</jukito.version>
        <junit.version>4.12</junit.version>
        <mockito.version>2.8.9</mockito.version>
        <nosqlunit.version>1.0.0-rc.5</nosqlunit.version>
        <restassured.version>2.9.0</restassured.version>
        <system-rules.version>1.16.1</system-rules.version>
        <powermock.version>1.7.0</powermock.version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.graylog2</groupId>
            <artifactId>graylog2-server</artifactId>
            <version>${graylog.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-joda-time</artifactId>
            <version>${assertj-joda-time.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.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${web.build-dir}</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.0.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <skipAssembly>true</skipAssembly>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <annotationProcessors>
                        <annotationProcessor>com.google.auto.value.processor.AutoValueProcessor</annotationProcessor>
                    </annotationProcessors>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Graylog-Plugin-Properties-Path>${project.groupId}.${project.artifactId}</Graylog-Plugin-Properties-Path>
                        </manifestEntries>
                    </archive>
                    <outputDirectory>target</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <minimizeJar>false</minimizeJar>
                    <artifactSet>
                        <includes>
                            <include>com.airbus-cyber-security.graylog:*</include>
                        </includes>
                    </artifactSet>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>jdeb</artifactId>
                <groupId>org.vafer</groupId>
                <version>1.5</version>
                <configuration>
                    <deb>${project.build.directory}/${project.artifactId}-${project.version}.deb</deb>
                    <dataSet>
                        <data>
                            <src>${project.build.directory}/${project.build.finalName}.jar</src>
                            <type>file</type>
                            <mapper>
                                <type>perm</type>
                                <prefix>${graylog2.plugin-dir}</prefix>
                                <filemode>644</filemode>
                                <user>root</user>
                                <group>root</group>
                            </mapper>
                        </data>
                    </dataSet>
                    <signPackage>true</signPackage>
                    <signMethod>dpkg-sig</signMethod>
                    <signRole>builder</signRole>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>rpm-maven-plugin</artifactId>
                <version>2.1.5</version>
                <configuration>
                    <group>Application/Internet</group>
                    <prefixes>
                        <prefix>/usr</prefix>
                    </prefixes>
                    <defineStatements>
                        <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
                        <defineStatement>_binaries_in_noarch_packages_terminate_build 0</defineStatement>
                    </defineStatements>
                    <defaultFilemode>644</defaultFilemode>
                    <defaultDirmode>755</defaultDirmode>
                    <defaultUsername>root</defaultUsername>
                    <defaultGroupname>root</defaultGroupname>
                    <mappings>
                        <mapping>
                            <directory>${graylog2.plugin-dir}</directory>
                            <sources>
                                <source>
                                    <location>${project.build.directory}/</location>
                                    <includes>
                                        <include>${project.build.finalName}.jar</include>
                                    </includes>
                                </source>
                            </sources>
                        </mapping>
                    </mappings>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <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-source-plugin</artifactId>
                <version>2.2.1</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>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
