<?xml version="1.0"?>
<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>
  <groupId>io.vertx</groupId>
  <artifactId>clojure-api</artifactId>
  
  <name>Clojure Vert.x API</name>
  <parent>
    <groupId>io.vertx</groupId>
    <artifactId>lang-clojure-parent</artifactId>
    <version>1.0.4</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-platform</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>testtools</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.directory.server</groupId>
          <artifactId>apacheds-protocol-dns</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>tools.nrepl</artifactId>
    </dependency>
    <dependency>
      <groupId>clj-stacktrace</groupId>
      <artifactId>clj-stacktrace</artifactId>
    </dependency>
    <dependency>
      <groupId>clojure-complete</groupId>
      <artifactId>clojure-complete</artifactId>
    </dependency>

    <dependency>
      <groupId>org.clojars.tcrawley</groupId>
      <artifactId>codox.core</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- We exclude this above and bring it in just as a test dep
         because it causes `lein deps:tree` to blow the stack, possibly due 
         to a cyclic dep? -->
    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-protocol-dns</artifactId>
      <version>1.5.7</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>

    <plugins>
    
      <plugin>
        <groupId>com.theoryinpractise</groupId>
        <artifactId>clojure-maven-plugin</artifactId>
        <version>${clojure.maven.plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <temporaryOutputDirectory>true</temporaryOutputDirectory>
          <warnOnReflection>true</warnOnReflection>
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>            
          </execution>
           <execution>
            <id>generate-codox</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <runWithTests>true</runWithTests>
              <includePluginDependencies>true</includePluginDependencies>
              <script>${basedir}/target/generate_codox.clj</script>
            </configuration>
          </execution>
          <execution>
            <id>download-js-artifacts</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <runWithTests>true</runWithTests>
              <includePluginDependencies>true</includePluginDependencies>
              <script>${basedir}/target/download_js_artifacts.clj</script>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven.resources.plugin.version}</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
        <executions>

          <execution>
            <id>codox-script</id>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>process-resources</phase>

            <configuration>
              <resources>
                <resource>
                  <filtering>true</filtering>
                  <directory>src/build</directory>
                  <includes>
                    <include>generate_codox.clj</include>
                    <include>download_js_artifacts.clj</include>
                  </includes>
                </resource>
              </resources>
              <outputDirectory>target</outputDirectory>
            </configuration>
          </execution>

        </executions>
      </plugin>

    </plugins>
  </build>
</project>
