<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2016, Karl Bennett
  ~  * Licensed under the BSD 3-Clause license.
  -->

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

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>org.webjars</groupId>

    <artifactId>jsmockito</artifactId>

    <version>1.0.4</version>

    <name>jsmockito</name>

    <packaging>jar</packaging>

    <description>WebJar for jsmockito</description>

    <url>http://webjars.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <upstream.version>1.0.4</upstream.version>
        <upstream.url>https://github.com/cleishm/jsmockito/releases/download/${upstream.version}/jsmockito-${upstream.version}.js</upstream.url>
        <download.file>${project.build.directory}/${project.artifactId}-${project.version}.js</download.file>
        <dest.dir>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</dest.dir>
        <dest.file>${dest.dir}/${project.artifactId}.js</dest.file>
        <requirejs>
            {
              "paths": {
                "jsmockito": "jsmockito"
              },
              "shim": {
                "jsmockito": ["jshamcrest"]
              }
            }
        </requirejs>
    </properties>

    <developers>
        <developer>
            <name>Karl Bennett</name>
            <email>karl.bennett.smt@gmail.com</email>
            <organization>shiver-me-timbers</organization>
            <organizationUrl>https://github.com/shiver-me-timbers</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>BSD 3-Clause License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>https://github.com/cleishm/jsmockito</distribution>
        </license>
    </licenses>

    <dependencies>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jshamcrest</artifactId>
            <version>0.7.0</version>
        </dependency>
    </dependencies>

    <scm>
        <url>http://github.com/webjars/${project.artifactId}</url>
        <connection>scm:git:https://github.com/webjars/${project.artifactId}.git</connection>
        <developerConnection>scm:git:https://github.com/webjars/${project.artifactId}.git</developerConnection>
        <tag>jsmockito-1.0.4</tag>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <echo message="download archive" />
                                <get src="${upstream.url}" dest="${download.file}" />
                                <echo message="moving resources" />
                                <copy file="${download.file}" tofile="${dest.file}" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.6</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
