<?xml version="1.0" encoding="UTF-8"?>
<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>com.yahoofinance-api</groupId>
    <artifactId>YahooFinanceAPI</artifactId>
    <version>3.6.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>YahooFinanceAPI</name>
    <description>This library provides some methods that should make it easy
        to communicate with the Yahoo Finance API.
        It allows you to request detailed information, some statistics
        and historical quotes on stocks.
        Separate functionality is available to request a simple FX quote.
        Please check the javadoc to get a complete overview of the available methods
        and to get an idea of which data is available from Yahoo Finance.</description>
    <url>http://financequotes-api.com</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/MIT</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Stijn Strickx</name>
            <email>api.yahoofinance@gmail.com</email>
            <organization>YahooFinanceAPI</organization>
            <organizationUrl>http://financequotes-api.com</organizationUrl>
        </developer>
    </developers>
    <issueManagement>
        <url>https://github.com/sstrickx/yahoofinance-api/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>
    <scm>
        <connection>scm:git:git://github.com/sstrickx/yahoofinance-api.git</connection>
        <developerConnection>scm:git:git@github.com:sstrickx/yahoofinance-api.git</developerConnection>
        <url>https://github.com/sstrickx/yahoofinance-api</url>
    </scm>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>

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

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>3.4.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.17</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>README.md</include>
                    <include>LICENSE.txt</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.8</version>
            </extension>
        </extensions>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Prepare for maven central -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.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-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Push to maven central -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.6</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <!-- Prepare for Github release -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.4.1</version>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>bin</descriptorRef>
                            </descriptorRefs>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <outputDirectory>${project.build.directory}/archive</outputDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Release to Github -->
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <version>1.1.1</version>
                        <configuration>
                            <description>Release version ${project.version}</description>
                            <releaseName>${project.artifactId}-${project.version}</releaseName>
                            <tag>v${project.version}</tag>
                            <repositoryId>sstrickx/yahoofinance-api</repositoryId>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}/archive</directory>
                                    <includes>
                                        <include>${project.artifactId}-${project.version}*.tar.bz2</include>
                                        <include>${project.artifactId}-${project.version}*.tar.gz</include>
                                        <include>${project.artifactId}-${project.version}*.zip</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>release</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Update website -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                            <execution>
                                <id>upload-javadoc</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>upload</goal>
                                </goals>
                                <configuration>
                                    <serverId>financequotes-api</serverId>
                                    <url>${yahoofinance.ssh.url}</url>
                                    <followSymLink>true</followSymLink>
                                    <fromDir>${project.build.directory}/apidocs</fromDir>
                                    <includes>**</includes>
                                    <toDir>www/yahoofinance/javadoc</toDir>
                                </configuration>
                            </execution>
                            <execution>
                                <id>update-version-web</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sshexec</goal>
                                </goals>
                                <configuration>
                                    <serverId>financequotes-api</serverId>
                                    <url>${yahoofinance.ssh.url}</url>
                                    <commands>
                                        <command>www/yahoofinance/release/release.sh ${project.version}</command>
                                    </commands>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>