<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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.lopht.maven-plugins</groupId>
    <artifactId>upload-maven-plugin</artifactId>
    <version>0.6.0</version>
    <packaging>maven-plugin</packaging>
    <name>Upload Maven Plugin</name>
    <url>https://github.com/lopht/upload-maven-plugin</url>
    <inceptionYear>2015</inceptionYear>
    <description>Upload file(s) to a URL via HTTP PUT</description>

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

    <scm>
        <url>https://github.com/lopht/upload-maven-plugin</url>
        <connection>scm:git:https://github.com/jgeorgeson/upload-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:lopht/upload-maven-plugin.git</developerConnection>
        <tag>upload-maven-plugin-0.6.0</tag>
    </scm>

    <developers>
        <developer>
            <email>jgeorgeson@lopht.net</email>
            <name>Justin Georgeson</name>
            <url>https://github.com/jgeorgeson</url>
            <id>jgeorgeson</id>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/lopht/upload-maven-plugin/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>bintray-lopht-maven</id>
            <name>lopht-maven</name>
            <url>https://api.bintray.com/maven/lopht/maven/upload-maven-plugin/;publish=1</url>
        </repository>
    </distributionManagement>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <httpclient-version>4.5.1</httpclient-version>
        <maven-version>3.0.5</maven-version>
        <maven-invoker-version>3.0.1</maven-invoker-version>
        <maven-plugin-version>3.5.1</maven-plugin-version>
        <mockserver-version>5.3.0</mockserver-version>
        <mockserver.serverPort>8080</mockserver.serverPort>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-plugin-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient-version}</version>
        </dependency>
        <dependency>
            <groupId>org.mock-server</groupId>
            <artifactId>mockserver-client-java</artifactId>
            <version>${mockserver-version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-version}</version>
                    <configuration>
                        <goalPrefix>upload</goalPrefix>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>${maven-invoker-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.mock-server</groupId>
                    <artifactId>mockserver-maven-plugin</artifactId>
                    <version>${mockserver-version}</version>
                </plugin>
                <!-- Attach javadoc -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <links>
                            <link>http://maven.apache.org/ref/3.0.5/maven-plugin-api/apidocs</link>
                        </links>
                        <additionalparam>-Xdoclint:none</additionalparam>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                    <!-- if you want to generate help goal -->
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.mock-server</groupId>
                <artifactId>mockserver-maven-plugin</artifactId>
                <configuration>
                    <initializationClass>net.lopht.maven.plugins.upload.MockServerInitializer</initializationClass>
                </configuration>
                <executions>
                    <execution>
                        <id>process-test-classes</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <configuration>
                    <addTestClassPath>true</addTestClassPath>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <properties>
                        <badServer>http://bad.example.com</badServer>
                        <goodServer>http://localhost:${mockserver.serverPort}</goodServer>
                    </properties>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Sign artifacts -->
                    <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</goal>
                                </goals>
                                <configuration>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- "Publish" site docs to gh-pages branch-->
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <version>0.12</version>
                        <configuration>
                            <message>Creating site for ${project.version}</message>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
