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

    <name>mvnwatcher</name>
    <description>Maven Plugin to watch file system changes and automatically restart builds</description>
    <url>https://github.com/dev9com/mvnwatcher</url>

    <groupId>com.dev9</groupId>
    <artifactId>watcher-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <version>1.6</version>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Will Iverson</name>
            <email>will DOT iverson AT dev9 DOT com</email>
            <organization>Dev9</organization>
            <organizationUrl>http://www.dev9.com/</organizationUrl>
            <timezone>America/Los_Angeles</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:dev9com/mvnwatcher.git</connection>
        <developerConnection>scm:git:git@github.com:dev9com/mvnwatcher.git</developerConnection>
        <url>git@github.com:dev9com/mvnwatcher.git</url>
    <tag>HEAD</tag>
  </scm>

    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <site>
            <id>site-docs</id>
            <url>file://${site-docs.url}</url>
        </site>
    </distributionManagement>

    <inceptionYear>2015</inceptionYear>

    <prerequisites>
        <maven>3.3.3</maven>
    </prerequisites>

    <properties>
        <!-- Eliminates the file encoding warning. Of course, all of your files
        are probably be UTF-8 nowadays. -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.url>https://github.com/dev9com/mvnrunnner</project.url>

        <!-- See https://github.com/mike-ensor/clickconcepts-master-pom/blob/master/pom.xml -->
        <site-docs.url>/${env.HOME}/sitedocs/${project.artifactId}</site-docs.url>
        <!-- Best practice is to override this property in your settings.xml file; used for directory to hold cloned repository -->
        <scmPublish.checkoutDirectory>${project.build.directory}/scmpublish</scmPublish.checkoutDirectory>
        <!-- @OVERRIDE this property per each project -->
        <repository.domain>github.com</repository.domain>
        <!-- @OVERRIDE this property per each project -->
        <repository.user>dev9com</repository.user>
        <!-- @OVERRIDE this property per each project -->
        <repository.name>mvnwatcher</repository.name>

    </properties>

    <issueManagement>
        <url>https://www.github.com/${repository.user}/${repository.name}/issues</url>
        <system>Github Issues</system>
    </issueManagement>

    <dependencies>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-invoker</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>18.0</version>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>4.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.3.3</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.3</version>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <!-- add support for ssh/scp -->
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.2</version>
            </extension>
            <extension>
                <!-- Deploy to WEBdav servers -->
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <!-- Yeah, ok, this is my OCD side showing.  ;)  -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.5.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <configuration>
                        <linksource>true</linksource>
                        <failOnError>false</failOnError>
                        <tags>
                            <tag>
                                <name>goal</name>
                                <placement>X</placement>
                            </tag>
                            <tag>
                                <name>phase</name>
                                <placement>X</placement>
                            </tag>
                            <tag>
                                <name>readonly</name>
                                <placement>X</placement>
                            </tag>
                            <tag>
                                <name>parameter</name>
                                <placement>X</placement>
                            </tag>
                            <tag>
                                <name>required</name>
                                <placement>X</placement>
                            </tag>
                        </tags>
                    </configuration>
                </plugin>
            </plugins>

        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <id>setup-test-project</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>process-test-classes</phase>
                        <configuration>
                            <failIfNoProjects>true</failIfNoProjects>
                            <pom>${project.build.directory}/test-classes/sample-project/pom.xml</pom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>

                <!-- It may be strange to configure this plugin in build, but that's where
                the dependency config goes. This configuration adds markdown support to the
                report generation. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>1.6</version>
                    </dependency>
                </dependencies>
            </plugin>


            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>nexus</serverId>
                    <nexusUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2</nexusUrl>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <reporting>
        <plugins>

            <!-- Basic report generation. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
            </plugin>

            <!-- Dependency version reporting. Relies on standard version numbering
            - you should use standard version numbering too!
            http://mojo.codehaus.org/versions-maven-plugin/version-rules.html -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <!-- Generates the Javadoc for the report. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
            </plugin>

        </plugins>
    </reporting>


    <profiles>
        <profile>
            <id>release-to-central</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign-and-deploy-file</goal>
                                </goals>
                                <configuration>
                                    <keyname>9B64859A</keyname>
                                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                                    <pomFile>pom.xml</pomFile>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <groupId>${project.groupId}</groupId>
                                    <version>${project.version}</version>

                                    <file>target/${project.artifactId}-${project.version}.jar</file>
                                    <files>
                                        target/${project.artifactId}-${project.version}-sources.jar,target/${project.artifactId}-${project.version}-javadoc.jar
                                    </files>
                                    <types>jar,jar</types>
                                    <classifiers>sources,javadoc</classifiers>
                                    <repositoryId>nexus</repositoryId>
                                    <gpgArguments>
                                        <argument>--armor</argument>
                                        <argument>--detach-sig</argument>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Used to push a build to Nexus, which can then be used to push to Central. -->
                    <!--<plugin>-->
                        <!--<groupId>org.sonatype.plugins</groupId>-->
                        <!--<artifactId>nexus-staging-maven-plugin</artifactId>-->
                        <!--<version>1.6.3</version>-->
                        <!--<extensions>true</extensions>-->
                        <!--<configuration>-->
                            <!--<serverId>nexus</serverId>-->
                            <!--<nexusUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2</nexusUrl>-->
                            <!--<autoReleaseAfterClose>true</autoReleaseAfterClose>-->
                        <!--</configuration>-->
                    <!--</plugin>-->

                </plugins>
            </build>
        </profile>

    </profiles>

</project>