<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.algolia</groupId>
    <artifactId>algoliasearch</artifactId>
    <version>3.16.1</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>5.4.0</junit.version>
        <assertj-core.version>3.19.0</assertj-core.version>
        <jsr305.version>3.0.2</jsr305.version>
        <doclint>none</doclint>
    </properties>

    <name>Algolia Search</name>
    <description>Java client for Algolia Search API</description>
    <url>https://github.com/algolia/algoliasearch-client-java-2</url>

    <scm>
        <connection>scm:git:git@github.com:algolia/algoliasearch-client-java-2.git</connection>
        <url>scm:git:git@github.com:algolia/algoliasearch-client-java-2.git</url>
        <developerConnection>scm:git:git@github.com:algolia/algoliasearch-client-java-2.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>algoliasearch-core</module>
        <module>algoliasearch-core-uber</module>
        <module>algoliasearch-apache</module>
        <module>algoliasearch-apache-uber</module>
        <module>algoliasearch-java-net</module>
    </modules>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>algolia</id>
            <name>Algolia SAS</name>
            <email>contact@algolia.com</email>
            <url>https://github.com/algolia/algoliasearch-client-java-2</url>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.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>

    <profiles>
        <profile>
            <id>standard-jar</id>
            <activation>
                <file>
                    <exists>src</exists>
                </file>
            </activation>
            <build>
                <resources>
                    <!--For generating the version.properties file-->
                    <resource>
                        <directory>algoliasearch-core/src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.5.1</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>test-jar</goal>
                                </goals>
                                <configuration>
                                    <skipIfEmpty>true</skipIfEmpty>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.22.0</version>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <source>1.8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>

            </build>

            <dependencies>
                <dependency>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                    <version>${jsr305.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-api</artifactId>
                    <version>${junit.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-engine</artifactId>
                    <version>${junit.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-params</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>
            </dependencies>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <source>1.8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</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>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <shadedClassifierName>uber</shadedClassifierName>
                                <createSourcesJar>true</createSourcesJar>
                                <filters>
                                    <filter>
                                        <artifact>*:*</artifact>
                                        <excludes>
                                            <exclude>META-INF/maven/**</exclude>
                                            <exclude>META-INF/services/**</exclude>
                                        </excludes>
                                    </filter>
                                    <filter>
                                        <artifact>com.fasterxml.*:*</artifact>
                                        <excludes>
                                            <exclude>META-INF/**</exclude>
                                        </excludes>
                                    </filter>
                                </filters>
                                <relocations>
                                    <relocation>
                                        <pattern>com.fasterxml.jackson</pattern>
                                        <shadedPattern>com.algolia.search.com.fasterxml.jackson</shadedPattern>
                                    </relocation>
                                    <relocation>
                                        <pattern>javax.annotation</pattern>
                                        <shadedPattern>com.algolia.search.javax.annotation</shadedPattern>
                                    </relocation>
                                </relocations>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.coveo</groupId>
                    <artifactId>fmt-maven-plugin</artifactId>
                    <!--
                         Do not upgrade this version to 2.10. Starting as of
                         2.10, the `google-java-format` transitive dependency is
                         upgraded to 1.8 which drops Java 8 support, which then
                         makes our Java 8 build fail.
                    -->
                    <version>2.9</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>format</goal>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>4.2.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
