<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>net.java.dev.jna</groupId>
    <artifactId>jna-parent</artifactId>
    <version>4.3.0-SNAPHSOT</version>
    <packaging>pom</packaging>

    <name>net.java.dev.jna:jna-parent</name>
    <url>https://github.com/java-native-access/jna</url>
    <licenses>
        <license>
            <name>LGPL, version 2.1</name>
            <url>http://www.gnu.org/licenses/licenses.html</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>Apache License v2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>twall</id>
            <name>Timothy Wall</name>
            <roles>
                <role>Owner</role>
            </roles>
        </developer>
    </developers>

    <prerequisites>
        <maven>${min.required.maven.version}</maven>
    </prerequisites>

    <modules>
        <module>../native</module>
    </modules>

    <scm>
        <connection>scm:git:https://github.com/java-native-access/jna</connection>
        <developerConnection>scm:git:ssh://git@github.com/java-native-access/jna.git</developerConnection>
        <url>https://github.com/java-native-access/jna</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- ### TODO find some way to import build.version.properties ### -->

        <!-- expected JVM versions -->
        <jvm.major.version>1</jvm.major.version>
        <jvm.minor.version>5</jvm.minor.version>
        <jvm.release.version>0</jvm.release.version>

        <javac.source>${jvm.major.version}.${jvm.minor.version}</javac.source>
        <project.build.java.source>${javac.source}</project.build.java.source>
        <maven.compiler.source>${javac.source}</maven.compiler.source>
        <ant.build.javac.source>${javac.source}</ant.build.javac.source>

        <javac.target>${javac.source}</javac.target>
        <project.build.java.target>${javac.target}</project.build.java.target>
        <maven.compiler.target>${javac.target}</maven.compiler.target>
        <ant.build.javac.target>${javac.target}</ant.build.javac.target>

        <min.required.maven.version>3.2</min.required.maven.version>
        <surefire.plugin.version>2.19</surefire.plugin.version>

        <ant.version>1.9.6</ant.version>
        <xmltask.version>1.16</xmltask.version>
        <ant-contrib.version>1.0b3</ant-contrib.version>

        <junit.version>4.12</junit.version>

        <javadoc.plugin.version>2.10.1</javadoc.plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <defaultGoal>package</defaultGoal>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>copy</goal>
                                            <goal>copy-dependencies</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute/>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.gmaven</groupId>
                                        <artifactId>gmaven-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>execute</goal>
                                            <goal>testCompile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>${javac.source}</source>
                        <target>${javac.target}</target>
                        <compilerArgument>-Xlint:-serial</compilerArgument>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <!-- see http://maven.apache.org/shared/maven-archiver/index.html -->
                        <archive>
                            <index>true</index>
                            <addMavenDescriptor>true</addMavenDescriptor>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <!-- Extra attributes added to the MANIFEST.MF file -->
                            <manifestEntries>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-VM-Version>${java.vm.version}</Java-VM-Version>
                                <User-Name>${user.name}</User-Name>
                                <!-- see Package constructor using Manifest -->
                                <Release-Timestamp>${maven.build.timestamp}</Release-Timestamp>
                                <Maven-Version>${maven.version}</Maven-Version>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                    <executions>
                        <execution>
                            <id>install</id>
                            <phase>install</phase>
                            <goals>        <!-- automatically download dependency sources - useful for debugging -->
                                <goal>sources</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.ant</groupId>
                            <artifactId>ant</artifactId>
                            <version>${ant.version}</version>
                        </dependency>
                        <dependency>    <!--Artificial dependency for tools.jar in case we invoke javac or javah -->
                            <groupId>com.sun</groupId>
                            <artifactId>tools</artifactId>
                            <version>${javac.source}</version>
                            <scope>system</scope>
                            <systemPath>${java.home}/../lib/tools.jar</systemPath>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <version>[${min.required.maven.version},)</version>
                        </requireMavenVersion>
                        <requireJavaVersion>
                            <version>[${javac.target},)</version>
                        </requireJavaVersion>
                    </rules>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.2</version>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>fast</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
                <maven.javadoc.skip>true</maven.javadoc.skip>
            </properties>
        </profile>
    </profiles>
</project>
