<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.jzeromq</groupId>
  <artifactId>zmq-jni</artifactId>
  <packaging>jar</packaging>
  <version>0.1.0</version>
  <name>zmq-jni</name>
  <description>Simple High Performance JNI Wrapper for ØMQ</description>
  <url>http://maven.apache.org</url>

  <developers>
    <developer>
      <name>Trevor Bernard</name>
      <email>trevor.bernard@gmail.com</email>
      <timezone>-4</timezone>
    </developer>
  </developers>

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

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

  <scm>
    <connection>scm:git:git@github.com:trevorbernard/zmq-jni.git</connection>
    <developerConnection>scm:git:git@github.com:trevorbernard/zmq-jni.git</developerConnection>
    <url>git@github.com:trevorbernard/zmq-jni.git</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.5.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.9</version>
          <configuration>
            <environmentVariables>
              <LD_LIBRARY_PATH>target</LD_LIBRARY_PATH>
              <DYLD_LIBRARY_PATH>target</DYLD_LIBRARY_PATH>
            </environmentVariables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.theoryinpractise</groupId>
        <artifactId>clojure-maven-plugin</artifactId>
        <version>1.3.13</version>
        <configuration>
          <sourceDirectories>
            <sourceDirectory>src/main/java</sourceDirectory>
          </sourceDirectories>
          <testSourceDirectories>
            <testSourceDirectory>src/test/clojure</testSourceDirectory>
          </testSourceDirectories>
          <clojureOptions>-Djava.library.path=target</clojureOptions>
          <warnOnReflection>true</warnOnReflection>
        </configuration>
        <executions>
          <execution>
            <id>test-clojure</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <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>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>native-maven-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>javah</goal>
            </goals>
            <configuration>
              <javahClassNames>
                <javahClassName>org.zeromq.jni.ZMQ</javahClassName>
              </javahClassNames>
              <javahOutputDirectory>${project.build.directory}/include</javahOutputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <id>buildlib</id>
            <phase>compile</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
              <executable>make</executable>
              <arguments>
                <argument>all</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>cleanlib</id>
            <phase>clean</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
              <executable>make</executable>
              <arguments>
                <argument>clean</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/classes/${os.name}/${os.arch}</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/target</directory>
                  <includes>
                    <include>*.so</include>
                    <include>*.dylib</include>
                    <include>*.dll</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
