<?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>
        <artifactId>helper-parent</artifactId>
        <groupId>me.lucko</groupId>
        <version>5.0.0</version>
    </parent>

    <artifactId>helper-profiles</artifactId>
    <packaging>jar</packaging>
    <version>1.2.0</version>

    <name>helper-profiles</name>
    <description>Provides a cached lookup service for player profiles.</description>
    <url>https://github.com/lucko/helper</url>

    <properties>
        <shade.pattern>me.lucko.helper.profiles.plugin.external.</shade.pattern>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <finalName>${project.name}</finalName>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>*.yml</include>
                </includes>
            </resource>
            <resource>
                <directory>../</directory>
                <filtering>false</filtering>
                <includes>
                    <include>LICENSE.txt</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${shade.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <minimizeJar>false</minimizeJar>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>com.github.ben-manes.caffeine:caffeine</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>com.github.benmanes.caffeine</pattern>
                                    <shadedPattern>${shade.pattern}caffeine</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deployment</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${source.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <!-- helper related dependencies -->
        <dependency>
            <groupId>me.lucko</groupId>
            <artifactId>helper</artifactId>
            <version>[5.0.0,6.0.0)</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>${bukkit.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- helper-profiles related dependencies -->
        <dependency>
            <groupId>me.lucko</groupId>
            <artifactId>helper-sql</artifactId>
            <version>1.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>2.6.2</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>

</project>