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

  <groupId>com.elasticpath</groupId>
  <artifactId>rest-viz-maven-plugin</artifactId>
  <version>0.1.0</version>
  <packaging>maven-plugin</packaging>

  <name>rest-viz-maven-plugin</name>
  <description>A Maven plugin for creating a graphical webapp for your Cortex resources</description>
  <url>https://github.com/elasticpath/rest-resource-viz</url>
  <inceptionYear>2017</inceptionYear>

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

  <developers>
    <developer>
      <name>Andrea Richiardi</name>
      <email>a.richiardi.work@gmail.com</email>
      <organization>Elastic Path</organization>
      <organizationUrl>http://www.elasticpath.com</organizationUrl>
    </developer>
    <developer>
      <name>Matt Bishop</name>
      <email>matt.bishop@elasticpath.com</email>
      <organization>Elastic Path</organization>
      <organizationUrl>http://www.elasticpath.com</organizationUrl>
    </developer>
  </developers>

  <organization>
    <name>Elastic Path</name>
    <url>http://www.elasticpath.com</url>
  </organization>

  <prerequisites>
    <maven>3.1.0</maven>
  </prerequisites>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.version>3.3.9</maven.version>
    <aether.version>1.13.1</aether.version>
    <clojure-maven.version>0.3.3</clojure-maven.version>
    <boot-interop.web-target-path>web-target</boot-interop.web-target-path>
    <boot-interop.output-path>mvn-target</boot-interop.output-path>
  </properties>

  <build>
    <sourceDirectory>src/plugin</sourceDirectory>
    <resources>
      <resource>
        <directory>src/plugin</directory>
        <includes>
          <include>**/*.clj</include>
        </includes>
        <excludes>
          <exclude>**/*_test.clj</exclude>
        </excludes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-more-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>${boot-interop.web-target-path}</directory>
                  <targetPath>web-assets</targetPath>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <localCheckout>true</localCheckout>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.ops4j</groupId>
        <artifactId>maven-inherit-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>inherit</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.0-beta-6</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <fail>true</fail>
              <failFast>true</failFast>
              <rules>
                <requireMavenVersion>
                  <version>[3.1.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

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

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5</version>
        <executions>
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>

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

  <dependencies>
    <dependency>
      <groupId>com.elasticpath</groupId>
      <artifactId>rest-resources-viz</artifactId>
      <version>0.1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>org.flatland</groupId>
      <artifactId>classlojure</artifactId>
      <version>0.7.1</version>
    </dependency>
    <dependency>
      <groupId>resauce</groupId>
      <artifactId>resauce</artifactId>
      <version>0.1.0</version>
    </dependency>

    <!-- Maven deps -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.6.1</version>
      <type>maven-plugin</type>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>clojars</id>
      <name>Clojars</name>
      <url>https://clojars.org/repo</url>
    </repository>
    <repository>
      <id>central</id>
      <name>Maven Central</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <id>snapshots</id>
      <name>Maven Shapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>clojars</id>
      <name>Clojars</name>
      <url>https://clojars.org/repo</url>
    </pluginRepository>
    <pluginRepository>
      <id>central</id>
      <name>Maven Central</name>
      <url>http://repo1.maven.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>

  <profiles>
    <profile>
      <id>sonatype-release</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.6</version>
            <!-- in order to hook gpg signing, add the following to settings.xml -->
            <!-- <profile> -->
            <!--   <id>default-profile</id> -->
            <!--   <activation> -->
            <!--     <activeByDefault>true</activeByDefault> -->
            <!--   </activation> -->
            <!--   <properties> -->
            <!--     <gpg.executable>/usr/bin/gpg2</gpg.executable> -->
            <!--     <gpg.useagent>true</gpg.useagent> -->
            <!--     <gpg.keyname>...</gpg.keyname> -->
            <!--     <gpg.passphrase>...</gpg.passphrase> -->
            <!--   </properties> -->
            <!-- </profile> -->
            <configuration>
              <keyName>${gpg.keyname}</keyName>
              <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>
    <profile>
      <id>boot-clj</id>
      <build>
        <directory>${boot-interop.output-path}</directory>
      </build>
    </profile>
  </profiles>

  <scm>
    <connection>scm:git:git://github.com:elasticpath/rest-resource-viz.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:elasticpath/rest-resource-viz.git</developerConnection>
    <url>https://github.com/elasticpath/rest-resource-viz</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
      <uniqueVersion>false</uniqueVersion>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
</project>
