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

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.airsonic.player</groupId>
    <artifactId>airsonic</artifactId>
    <version>11.0.0-SNAPSHOT</version>
    <name>Airsonic</name>
    <packaging>pom</packaging>
    <organization>
        <name>Airsonic</name>
        <url>https://airsonic.org/</url>
    </organization>
    <inceptionYear>2016</inceptionYear>

    <properties>
        <failOnDependencyWarning>true</failOnDependencyWarning>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <cxf.version>3.3.6</cxf.version>
        <jackson.version>2.11.0</jackson.version>
        <tomcat.version>9.0.34</tomcat.version>
        <docker.container.repo>airsonic/airsonic</docker.container.repo>
    </properties>

    <repositories>
        <repository>
            <id>local1</id>
            <name>Local Repository</name>
            <url>file://${project.basedir}/../repo</url>
        </repository>
        <repository>
            <id>jaudiotagger-repository</id>
            <url>https://dl.bintray.com/ijabz/maven</url>
        </repository>
        <repository>
          <id>4thline-repo</id>
          <url>http://4thline.org/m2</url>
          <snapshots>
              <enabled>false</enabled>
          </snapshots>
      </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>local1</id>
            <name>Local Repository</name>
            <url>file://${project.basedir}/../repo</url>
        </pluginRepository>
    </pluginRepositories>

    <scm>
        <connection>scm:git:git://github.com/airsonic/airsonic.git</connection>
        <developerConnection>scm:git:git@github.com:airsonic/airsonic.git</developerConnection>
        <url>https://github.com/airsonic/airsonic.git</url>
    </scm>

<!--    <ciManagement>
        <system>continuum</system>
        <notifiers>
            <notifier>
                <type>mail</type>
                <configuration>
                    <address>sindre@activeobjects.no</address>
                </configuration>
            </notifier>
        </notifiers>
    </ciManagement> -->

    <developers>
        <developer>
            <name>Eugene E. Kashpureff Jr</name>
            <email>eugene@kashpureff.org</email>
        </developer>
    </developers>

    <modules>
        <module>subsonic-rest-api</module>
        <module>airsonic-sonos-api</module>
        <module>airsonic-main</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.2.6.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <!-- Spring Boot 2.2.6 doesn't update log4j yet, fixes CVE -->
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>2.13.2</version>
            </dependency>
            <dependency>
                <!-- Spring Boot 2.2.6 doesn't update log4j yet, fixes CVE -->
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-to-slf4j</artifactId>
                <version>2.13.2</version>
            </dependency>
            <dependency>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-core</artifactId>
                <version>3.8.9</version>
            </dependency>

            <!-- Fix convergence issues -->
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>5.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.10</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.6</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>28.2-jre</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant</artifactId>
                <version>1.10.5</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>1.3.5</version>
            </dependency>
            <dependency>
                <groupId>org.jvnet.staxex</groupId>
                <artifactId>stax-ex</artifactId>
                <version>1.8.3</version>
            </dependency>


            <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>2.3.2</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jaxb</groupId>
                <artifactId>jaxb-runtime</artifactId>
                <version>2.3.2</version>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.ws</groupId>
                <artifactId>jakarta.xml.ws-api</artifactId>
                <version>2.3.2</version>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.soap</groupId>
                <artifactId>jakarta.xml.soap-api</artifactId>
                <version>1.4.1</version>
            </dependency>
            <dependency>
                <groupId>jakarta.jws</groupId>
                <artifactId>jakarta.jws-api</artifactId>
                <version>1.1.1</version>
            </dependency>

            <!-- Tomcat dependencies are normally managed by Spring Boot, but we handle
                 patch version updates ourselves in order to fix CVEs. -->
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-el</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-jasper</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-websocket</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-annotations-api</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <version>${tomcat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-juli</artifactId>
                <version>${tomcat.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-codegen-plugin</artifactId>
                    <version>${cxf.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.14.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.2.3</version>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.1.0</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <configuration>
                                <configLocation>${project.basedir}/../checkstyle.xml</configLocation>
                                <encoding>UTF-8</encoding>
                                <consoleOutput>true</consoleOutput>
                                <failOnViolation>true</failOnViolation>
                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            </configuration>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.airsonic</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>1.0-RELEASE</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>3.13.0</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <configuration>
                                <sourceEncoding>utf-8</sourceEncoding>
                            </configuration>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>5.3.2</version>
                    <inherited>true</inherited>
                    <configuration>
                        <failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
                        <suppressionFiles>
                            <suppressionFile>${project.basedir}/cve-suppressed.xml</suppressionFile>
                        </suppressionFiles>
                        <!-- disabled due to the poor quality of the data from this analyzer -->
                        <ossindexAnalyzerEnabled>false</ossindexAnalyzerEnabled>
                    </configuration>
                    <executions>
                        <execution>
                            <id>run-dependency-checker</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                        <configuration>
                            <!-- #1186 Temporarily skip a test. -->
                            <excludes>
                                <exclude>org.airsonic.player.service.search.*TestCase.java</exclude>
                            </excludes>
                        </configuration>
                </plugin>
                <plugin>
                    <groupId>net.nicoulaj.maven.plugins</groupId>
                    <artifactId>checksum-maven-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>artifacts</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <algorithms>
                            <algorithm>SHA-256</algorithm>
                        </algorithms>
                        <individualFiles>false</individualFiles>
                        <shasumSummary>true</shasumSummary>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <verbose>false</verbose>
                    <compilerVersion>1.8</compilerVersion>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>${failOnDependencyWarning}</failOnWarning>
                            <ignoreNonCompile>true</ignoreNonCompile>
                            <ignoredUsedUndeclaredDependencies>
                                <ignoredUsedUndeclaredDependency>org.springframework:*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>org.springframework.security:*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>org.springframework.boot:*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>org.apache.tomcat.embed:tomcat-embed-core*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>org.apache.tomcat:tomcat-annotations-api:*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>org.apache.tomcat.embed:tomcat-embed-el*</ignoredUsedUndeclaredDependency>
                                <!-- Needed by Apache CXF -->
                                <ignoredUsedUndeclaredDependency>javax.annotation:javax.annotation-api:*</ignoredUsedUndeclaredDependency>
                                <ignoredUsedUndeclaredDependency>javax.xml.ws:jaxws-api:*</ignoredUsedUndeclaredDependency>
                            </ignoredUsedUndeclaredDependencies>
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>com.sun.mail:jakarta.mail*</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.seamless:seamless-http*</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>taglibs:string:jar*</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.seamless:seamless-http*</ignoredUnusedDeclaredDependency>
                                <!-- Needed for airsonic-booter to load Airsonic correctly -->
                                <ignoredUnusedDeclaredDependency>org.springframework.security:*</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.springframework.boot:spring-boot*</ignoredUnusedDeclaredDependency>
                                <!-- Needed by Apache CXF -->
                                <ignoredUnusedDeclaredDependency>jakarta.xml.ws:jakarta.xml.ws-api</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>jakarta.xml.bind:jakarta.xml.bind-api</ignoredUnusedDeclaredDependency>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence/>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>docker</id>
            <modules>
                <module>subsonic-rest-api</module>
                <module>airsonic-sonos-api</module>
                <module>airsonic-main</module>
                <module>install/docker</module>
            </modules>
        </profile>
        <profile>
            <id>integration-test</id>
            <modules>
                <module>subsonic-rest-api</module>
                <module>airsonic-sonos-api</module>
                <module>airsonic-main</module>
                <module>install/docker</module>
                <module>integration-test</module>
            </modules>
        </profile>
    </profiles>
</project>
