<?xml version="1.0"?>
<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>

    <groupId>org.nameapi.client</groupId>
    <artifactId>nameapi-client</artifactId>
    <name>nameapi-client</name>
    <version>5.0.1</version>

    <url>https://github.com/optimaize/nameapi-client-java</url>
    <description>
        Java Client for the NameAPI Web Service.
    </description>
    <organization>
        <name>Optimaize GmbH, Switzerland</name>
        <url>http://www.optimaize.com/</url>
    </organization>
    <developers>
        <developer>
            <name>Fabian Kessler</name>
        </developer>
        <developer>
            <name>Alexei Arshavin</name>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/optimaize/nameapi-client-java.git</connection>
        <developerConnection>scm:git:git@github.com:optimaize/nameapi-client-java.git</developerConnection>
        <url>http://github.com/optimaize/nameapi-client-java</url>
        <tag>nameapi-client-5.0.1</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.7</java.version>
        <anythingworks.version>0.5</anythingworks.version>
        <ontology.version>5.0.2</ontology.version>
        <swagger-annotations-version>1.5.4</swagger-annotations-version>
    </properties>

    <build>
        <resources>
            <resource><!-- this is default, but because we tamper with the resources, we need to explicitly mention it. -->
                <directory>src/main/resources</directory>
            </resource>
            <resource><!-- Include the README and LICENSE files: -->
                <directory>${project.basedir}</directory>
                <includes>
                    <include>README*</include>
                    <include>LICENSE*</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Required: javadoc JAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <!-- Automated passphrase entry: -->

                    <!-- To pass your passphrase to the build automatically, so avoiding
                    manual interaction, you'll need to put the passphrase into settings.xml.
                    You don't really want that to be in plain text, so you'll want to follow:
                    http://maven.apache.org/guides/mini/guide-encryption.html -->
                    <!-- <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments> -->

                    <!-- Manual passphrase entry: -->

                    <!-- This is the simplest secure solution, but requires you to type
                    your key passphrase in manually when performing a release. No biggie unless
                    you want your CI server to decide when to release for you. -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.4</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <!--<configuration>-->
                        <!--<passphrase>${gpg.passphrase}</passphrase>-->
                        <!--</configuration>-->
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.optimaize.anythingworks.client.rest</groupId>
            <artifactId>anythingworks-client-rest</artifactId>
            <version>${anythingworks.version}</version>
        </dependency>

        <dependency>
            <groupId>org.nameapi.ontology.core</groupId>
            <artifactId>nameapi-ontology5-core</artifactId>
            <version>${ontology.version}</version>
        </dependency>

        <dependency>
            <groupId>com.intellij</groupId>
            <artifactId>annotations</artifactId>
            <version>12.0</version>
        </dependency>



        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger-annotations-version}</version>
        </dependency>


        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <!-- updated on 2015-11-04 -->
            <version>6.9.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
