<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2011 Brockmann Consult GmbH (info@brockmann-consult.de)
  ~
  ~ This program is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU General Public License as published by the Free
  ~ Software Foundation; either version 3 of the License, or (at your option)
  ~ any later version.
  ~ This program is distributed in the hope that it will be useful, but WITHOUT
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  ~ more details.
  ~
  ~ You should have received a copy of the GNU General Public License along
  ~ with this program; if not, see http://www.gnu.org/licenses/
  -->
<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.esa.snap</groupId>
        <artifactId>snap-engine</artifactId>
        <version>7.0.0-SNAPSHOT</version>
    </parent>

    <groupId>ncsa.hdf</groupId>
    <artifactId>lib-hdf</artifactId>
    <version>2.7.1</version>
    <packaging>nbm</packaging>

    <name>HDF Library</name>
    <description>A wrapper module for the native libraries used to read data products in HDF format.</description>
    <url>http://www.hdfgroup.org/</url>
    <licenses>
        <license>
            <name>Hierarchical Data Format (HDF) Software Library and Utilities</name>
            <url>http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING</url>
        </license>
        <license>
            <name>HDF5 (Hierarchical Data Format 5) Software Library and Utilities</name>
            <url>http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING</url>
        </license>
    </licenses>

    <dependencies>
        <dependency>
            <groupId>ncsa.hdf</groupId>
            <artifactId>jhdf</artifactId>
            <version>2.7</version>
        </dependency>
        <dependency>
            <groupId>ncsa.hdf</groupId>
            <artifactId>jhdf5</artifactId>
            <version>2.7</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-natives</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>ncsa.hdf</groupId>
                                    <artifactId>hdf-natives</artifactId>
                                    <version>${hdf.version}</version>
                                    <type>zip</type>
                                    <outputDirectory>src/main/resources/lib</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/resources/lib</directory>
                            <includes>
                                <include>**/*</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <configuration>
                    <publicPackages>
                        <publicPackage>ncsa.hdf.*</publicPackage>
                    </publicPackages>
                    <nbmResources>
                        <nbmResource>
                            <directory>src/main/resources/lib/</directory>
                            <targetPath>modules/lib/</targetPath>
                            <includes>
                                <include>**/*.dll</include>
                                <include>**/*.so</include>
                                <include>**/*.jnilib</include>
                            </includes>
                        </nbmResource>
                    </nbmResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

