<?xml version="1.0" encoding="UTF-8"?>
<!-- Top-level POM for Java-CSML library -->
<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>uk.ac.rdg.resc</groupId>
    <version>1.5.3</version>
    <artifactId>edal</artifactId>
    <name>Environmental Data Abstraction Library</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Enables auto-insertion of licence in new source code files. 
            Could be extracted to a separate settings file, as per http://mevenide.codehaus.org/m2-site/mevenide2-netbeans/customizations.html -->
        <netbeans.hint.license>bsd-3clause</netbeans.hint.license>
        <gwtversion>2.8.2</gwtversion>
    </properties>

    <packaging>pom</packaging>
    <url>http://Reading-eScience-Centre.github.io/edal-java/</url>
    <inceptionYear>2010</inceptionYear>
    <description>EDAL (Environmental Data Abstraction Library) is a set of Java libararies that provide a consistent means for accessing and manipulating environmental data. The core concepts are based on the standards-compliant data model of the Climate Science Modelling Language.</description>
    <organization>
        <name>Reading e-Science Centre, University of Reading, UK</name>
        <url>http://www.met.reading.ac.uk/resc/home/</url>
    </organization>
    <licenses>
        <license>
            <url>https://raw.githubusercontent.com/Reading-eScience-Centre/edal-java/master/licence.txt</url>
            <name>Modified BSD licence</name>
            <comments>Permits redistribution and use in source and binary form
            provided that the copyright notice is retained (see licence for
            full details).</comments>
        </license>
    </licenses>
    <!-- groupId, developers and build sections are all inherited by child 
        modules -->
    <developers>
        <developer>
            <name>Jon Blower</name>
            <organization>Reading e-Science Centre, University of Reading, UK</organization>
            <organizationUrl>http://www.resc.reading.ac.uk</organizationUrl>
            <email>j.d.blower@reading.ac.uk</email>
        </developer>
        <developer>
            <name>Guy Griffiths</name>
            <organization>Reading e-Science Centre, University of Reading, UK</organization>
            <organizationUrl>http://www.resc.reading.ac.uk</organizationUrl>
            <email>guy.griffiths@reading.ac.uk</email>
        </developer>
    </developers>
    <build>
        <plugins>
            <plugin>
                <!-- Sets the source version to Java 11 -->
			    <groupId>org.apache.maven.plugins</groupId>
			    <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
                <version>3.8.1</version>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>edal-java-release</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
                <version>2.9</version>
            </plugin>
            <plugin>
                <!-- Create aggregated javadoc for all modules -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <!-- Output the apidocs to the base directory. These 
                        are ignored in .gitignore for most branches, but NOT in the gh-pages branch. 
                        This makes documentation deployment very simple -->
                    <reportOutputDirectory>${project.basedir}</reportOutputDirectory>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <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-enforcer-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <docfilessubdirs>true</docfilessubdirs>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <version>2.2.1</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/Reading-eScience-Centre/edal-java/issues</url>
    </issueManagement>
    <reporting>
        <plugins>
            <plugin>
                <!-- Create aggregated javadoc for all modules -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <goal>javadoc:aggregate</goal>
                    <!-- These links really belong in the child POMs but 
                        if we put them there, they don't seem to get picked up when building the 
                        javadoc for the aggregated project. Therefore if the versions of any of the 
                        dependencies change these links will also have to be updated. -->
                    <links>
                        <link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>
                        <link>https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/</link>
                        <link>https://www.joda.org/joda-time/apidocs/</link>
                        <link>http://www.geoapi.org/3.0/javadoc/</link>
                    </links>
                    <source>8</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
            </plugin>
            <plugin>
                <!-- This means that we only generate javadocs for the site -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.6</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
    <dependencies>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>2.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <scm>
        <connection>scm:git:ssh://github.com/Reading-eScience-Centre/edal-java</connection>
        <developerConnection>scm:git:ssh://github.com/Reading-eScience-Centre/edal-java</developerConnection>
        <url>https://github.com/Reading-eScience-Centre/edal-java</url>
    </scm>
    <distributionManagement>
        <!-- use the following if you're not using a snapshot version. -->
        <repository>
            <id>edal-java-release</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>edal-snapshots</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    <modules>
        <!-- Note that these are relative directory paths, not artifactIds! -->
        <module>examples</module>
        <module>common</module>
        <module>graphics</module>
        <module>godiva</module>
        <module>coveragejson</module>
        <module>xml-catalogue</module>
        <module>wms</module>
        <module>cdm</module>
    </modules>
    <repositories>
        <repository>
            <!-- This allows us to include local maven repos in each module 
                to contain dependencies which are not available through maven. We have only 
                a single example, in the graphics module. We could define it in the graphics 
                pom.xml, but that means that javadoc generation fails when we call it from 
                this level. -->
            <id>libs</id>
            <name>Non-maven dependencies</name>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <url>file://${project.basedir}/lib</url>
        </repository>
    </repositories>
</project>
