<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>xyz.gianlu.librespot</groupId>
    <artifactId>librespot-java</artifactId>
    <packaging>pom</packaging>
    <version>1.5.2</version>

    <name>librespot-java</name>
    <description>Java port of librespot, the Open Source Spotify client library</description>

    <url>http://github.com/librespot-org/librespot-java</url>

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

    <developers>
        <developer>
            <name>Gianluca Altomani</name>
            <email>altomanigianluca@gmail.com</email>
            <url>https://gianlu.xyz</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/librespot-org/librespot-java.git</connection>
        <developerConnection>scm:git:ssh://github.com:librespot-org/librespot-java.git</developerConnection>
        <url>http://github.com/librespot-org/librespot-java/</url>
    </scm>

    <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>
        <gson.version>2.8.6</gson.version>
        <protobuf.version>3.14.0</protobuf.version>
    </properties>

    <modules>
        <module>lib</module>
        <module>player</module>
        <module>api</module>
    </modules>

    <dependencies>
        <!-- Annotations -->
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>20.1.0</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.13.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.13.3</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.lmax</groupId>
            <artifactId>disruptor</artifactId>
            <version>3.4.2</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Unit tests -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Run tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>debug</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>debug</name>
                </property>
            </activation>
        </profile>
        <profile>
            <id>ossrh</id>
            <activation>
                <property>
                    <name>ossrh</name>
                </property>
            </activation>

            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.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>3.2.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <quiet>true</quiet>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>

                    <!-- To release to Maven central -->
                    <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>
                        </configuration>
                    </plugin>

                    <!-- To sign the artifacts -->
                    <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>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>github</id>
            <activation>
                <property>
                    <name>github</name>
                </property>
            </activation>

            <distributionManagement>
                <repository>
                    <id>github</id>
                    <url>https://maven.pkg.github.com/librespot-org/librespot-java</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>