<!--
  ~ Copyright 2021 devgianlu
  ~
  ~ 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: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.6.1</version>

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

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

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://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>https://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.7</gson.version>
        <protobuf.version>3.17.3</protobuf.version>
        <slf4j-api.version>1.7.31</slf4j-api.version>
        <log4j.version>2.14.1</log4j.version>
        <lmax-disruptor.version>3.4.4</lmax-disruptor.version>
    </properties>

    <modules>
        <module>sink-api</module>
        <module>sink</module>
        <module>decoder-api</module>
        <module>dacp</module>
        <module>lib</module>
        <module>player</module>
        <module>api</module>
    </modules>

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

        <!-- Unit tests -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.7.2</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.3.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>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </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>