<?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">


    <!-- ====================================================================== -->
    <!-- P R O J E C T  D E S C R I P T I O N                                   -->
    <!-- ====================================================================== -->

    <modelVersion>4.0.0</modelVersion>
    <groupId>io.clickhandler</groupId>
    <artifactId>gwt-lumberjack</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <name>gwt-lumberjack</name>
    <description>Simple GWT logging</description>
    <url>http://www.clickhandler.io</url>
    <organization>
        <name>ClickHandlerIO LLC</name>
        <url>http://www.clickhandler.io</url>
    </organization>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Chris Jones</name>
            <organization>ClickHandlerIO</organization>
            <organizationUrl>http://www.clickhandler.io</organizationUrl>
        </developer>
        <developer>
            <name>Bo Molocznik</name>
            <organization>ClickHandlerIO</organization>
            <organizationUrl>http://www.clickhandler.io</organizationUrl>
        </developer>
        <developer>
            <name>Clay Molocznik</name>
            <organization>ClickHandlerIO</organization>
            <organizationUrl>http://www.clickhandler.io</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com:ClickHandlerIO/gwt-lumberjack</connection>
        <developerConnection>scm:git:git@github.com:ClickHandlerIO/gwt-lumberjack.git</developerConnection>
        <url>git@github.com:ClickHandlerIO/gwt-lumberjack</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <gwt.version>2.8.2</gwt.version>
        <loggly-gwt.version>1.0.0</loggly-gwt.version>
        <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
        <gwt-maven-plugin.version>2.8.2</gwt-maven-plugin.version>
        <build-helper-maven-plugin.version>1.10</build-helper-maven-plugin.version>
        <maven-resources-plugin.version>2.5</maven-resources-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.6</nexus-staging-maven-plugin.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>

        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>

        <repository>
            <id>google-snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>

        <pluginRepository>
            <id>plugin-snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/public/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>


    <!-- ====================================================================== -->
    <!-- D E P E N D E N C I E S                                                -->
    <!-- ====================================================================== -->

    <dependencies>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwt.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-elemental</artifactId>
            <version>${gwt.version}</version>
        </dependency>

        <dependency>
            <groupId>io.clickhandler</groupId>
            <artifactId>loggly-gwt</artifactId>
            <version>${loggly-gwt.version}</version>
        </dependency>

    </dependencies>


    <!-- ====================================================================== -->
    <!-- P R O F I L E S                                                        -->
    <!-- ====================================================================== -->

    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/java</directory>
                        <!--<filtering>true</filtering>-->

                        <!-- Exclude node stuff, Gulp build file, raw theme  -->
                       <!-- <excludes>
                            <exclude>remark/package.json</exclude>
                            <exclude>remark/node_modules/**</exclude>
                            <exclude>remark/Gulpfile.js</exclude>
                            <exclude>remark/theme/**</exclude>
                        </excludes>-->
                    </resource>
                </resources>

                <plugins>

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

                    <!-- Include generated sources in output and filter fonts and images (fonts do not work if they do not get filtered). -->
                   <!-- <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>${maven-resources-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${basedir}/target/generated-sources/annotations</directory>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>

                                    <nonFilteredFileExtensions>
                                        <nonFilteredFileExtension>woff</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>eot</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>jpg</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>jpeg</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>gif</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>png</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>svg</nonFilteredFileExtension>
                                        <nonFilteredFileExtension>ico</nonFilteredFileExtension>
                                    </nonFilteredFileExtensions>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>-->

                    <!-- Add Dagger generated sources to the source path. GWT compile needs this. -->
                    <!--<plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>${build-helper-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>target/generated-sources/annotations</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>-->

                    <!-- GWT Compile -->
                    <!--<plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <version>${gwt-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>gwt-compile</id>
                                <phase>compile</phase>
                                <configuration>
                                    <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
                                    <localWorkers>3</localWorkers>
                                    <persistentunitcache>false</persistentunitcache>
                                    <style>pretty</style>
                                    <compileReport>true</compileReport>
                                </configuration>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>-->

                    <!-- Source JAR -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.0.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.3</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Sign GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <passphraseServerId>clickhandler.io.gpg.passphrase</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Deploy to maven central -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>
</project>
