<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>com.metsci.glimpse</groupId>
    <artifactId>glimpse-parent</artifactId>
    <version>4.0.0</version>
    <packaging>pom</packaging>

    <name>Glimpse</name>
    <description>Glimpse is a library for building dynamic, interactive Java applications for visualizing Big Data.</description>
    <url>http://glimpse.metsci.com/</url>
    <licenses>
        <license>
            <name>The BSD 3-Clause License</name>
            <url>http://glimpse.metsci.com/licenses/glimpse-license.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:metsci/glimpse.git</connection>
        <developerConnection>scm:git:git@github.com:metsci/glimpse.git</developerConnection>
        <url>git@github.com:metsci/glimpse.git</url>
    </scm>
    <organization>
        <name>Metron, Inc.</name>
        <url>http://www.metsci.com</url>
    </organization>
    <developers>
        <developer>
            <id>ulman</id>
            <name>Geoff Ulman</name>
            <email>ulman@metsci.com</email>
        </developer>
        <developer>
            <id>osborn</id>
            <name>Bryan Osborn</name>
            <email>osborn@metsci.com</email>
        </developer>
        <developer>
            <id>hogye</id>
            <name>Mike Hogye</name>
            <email>hogye@metsci.com</email>
        </developer>
    </developers>

    <modules>

        <module>util</module>
        <module>util-examples</module>

        <module>text</module>

        <module>platform-fixes</module>

        <module>core</module>
        <module>core-examples</module>

        <module>layers</module>
        <module>layers-examples</module>

        <module>docking</module>
        <module>docking-examples</module>

        <module>extras-charts</module>
        <module>extras-dnc</module>
        <module>extras-examples</module>
        <module>extras-tinylaf</module>
        <module>extras-topo</module>

    </modules>

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

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce-maven35</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.5,)</version>
                                    <message>Build requires Maven 3.5+</message>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>require-java9</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[9,)</version>
                                    <message>Build requires Java 9+ JDK</message>
                                </requireJavaVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <show>public</show>
                    <maxmemory>2056m</maxmemory>
                    <doctitle>Glimpse Data Visualization Library</doctitle>
                    <doclint>none</doclint>
                    <additionalDependencies>
                        <!-- Keep javadoc from choking on xml-bind-api deps; more info in the docking POM -->
                        <additionalDependency>
                            <groupId>jakarta.xml.bind</groupId>
                            <artifactId>jakarta.xml.bind-api</artifactId>
                            <version>2.3.2</version>
                        </additionalDependency>
                        <additionalDependency>
                            <groupId>jakarta.activation</groupId>
                            <artifactId>jakarta.activation-api</artifactId>
                            <version>1.2.1</version>
                        </additionalDependency>
                    </additionalDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- sign deployed maven artifacts -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <!-- This may get overridden and/or augmented by active profiles -->
                    <release>9</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <useModulePath>false</useModulePath>
                            <argLine>
                             --add-opens java.base/java.nio=ALL-UNNAMED
                             --add-opens java.base/sun.nio.ch=ALL-UNNAMED
                             --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
                             --add-opens java.desktop/java.awt=ALL-UNNAMED
                             --add-opens java.desktop/sun.awt=ALL-UNNAMED
                             --add-opens java.desktop/sun.java2d=ALL-UNNAMED
                            </argLine>
                        </configuration>
                    </execution>
                    <execution>
                        <id>modular-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <useModulePath>true</useModulePath>
                            <argLine>
                             --add-opens java.base/java.nio=com.metsci.glimpse.util
                             --add-opens java.base/sun.nio.ch=com.metsci.glimpse.util
                             --add-opens java.base/jdk.internal.ref=com.metsci.glimpse.util
                             --add-opens java.desktop/java.awt=com.metsci.glimpse.core
                             --add-opens java.desktop/sun.awt=com.jogamp.opengl
                             --add-opens java.desktop/sun.java2d=com.jogamp.opengl
                            </argLine>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- add the current commit SHA to the build jar -->
            <plugin>
                <groupId>com.github.koraktor</groupId>
                <artifactId>mavanagaiata</artifactId>
                <version>0.9.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>commit</goal>
                        </goals>
                        <configuration>
                            <skipNoGit>true</skipNoGit>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                            <SCM-Revision>${mvngit.commit.id}</SCM-Revision>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <basedir>${basedir}</basedir>
                    <header>${basedir}/LICENSE</header>
                    <quiet>false</quiet>
                    <strictCheck>true</strictCheck>
                    <failIfMissing>false</failIfMissing>
                    <aggregate>true</aggregate>
                    <includes>
                        <include>src/main/java/**</include>
                        <include>src/test/java/**</include>
                        <include>**/*.fs</include>
                        <include>**/*.vs</include>
                        <include>**/*.gs</include>
                    </includes>
                    <mapping>
                        <!-- using JAVADOC_STYLE can sometimes cause the
                            license header to find its way into the javadocs, so SLASHSTAR_STYLE is used -->
                        <java>SLASHSTAR_STYLE</java>
                        <fs>DOUBLESLASH_STYLE</fs>
                        <vs>DOUBLESLASH_STYLE</vs>
                        <gs>DOUBLESLASH_STYLE</gs>
                    </mapping>
                    <excludes>
                        <exclude>target/**</exclude>
                        <!-- don't put license header on package descriptions.
                            If no other javadoc is provided, the first line of the license header ends
                            up in the javadoc. -->
                        <exclude>**/package-info.java</exclude>
                        <exclude>**/module-info.java</exclude>
                        <!-- these classes have their own license headers -->
                        <exclude>**/charts/bathy/Conrec.java</exclude>
                        <exclude>**/charts/bathy/Render.java</exclude>
                        <exclude>**/CsvTokenizer.java</exclude>
                        <exclude>**/GenericSorting.java</exclude>
                        <exclude>**/AttributedTextRenderer.java</exclude>
                        <exclude>**/MD5Checksum.java</exclude>
                        <exclude>**/TextureAtlas.java</exclude>
                        <exclude>**/ElevatedSurfaceTileRenderer.java</exclude>
                        <exclude>**/ElevatedSectorGeometryList.java</exclude>
                        <exclude>**/RectanglePacker.java</exclude>
                    </excludes>
                    <useDefaultExcludes>true</useDefaultExcludes>
                    <useDefaultMapping>true</useDefaultMapping>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- explicitly define maven-deploy-plugin after other to
                    force exec order -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- explicitly define maven-install-plugin after other to
                    force exec order -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <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>[2.1,)</versionRange>
                                        <goals>
                                            <goal>resolve</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.github.koraktor</groupId>
                                        <artifactId>mavanagaiata</artifactId>
                                        <versionRange>[0.5.0,)</versionRange>
                                        <goals>
                                            <goal>commit</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-javadoc-plugin</artifactId>
                                        <versionRange>[2.9.1,)</versionRange>
                                        <goals>
                                            <goal>jar</goal>
                                            <goal>javadoc</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <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>

        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.12</version>
            </extension>
        </extensions>
    </build>

    <profiles>
        <profile>
            <id>java8-only</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <!-- Override the common compiler config to be Java 8 only -->
                            <release>8</release>
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>java8-compat</id>
            <activation>
                <property>
                    <name>!m2e.version</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <execution>
                                <!-- After default-compile, recompile everything (except module-info) with Java 8 -->
                                <id>java8-recompile</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <release>8</release>
                                    <excludes>
                                        <exclude>module-info.java</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                            <execution>
                                <!-- Override default-testCompile to be Java 8 only -->
                                <id>default-testCompile</id>
                                <configuration>
                                    <release>8</release>
                                    <excludes>
                                        <exclude>module-info.java</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>public-release</id>
            <activation>
                <property>
                    <name>public.release</name>
                </property>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>

        <profile>
            <id>internal</id>
            <activation>
                <property>
                    <name>!public.release</name>
                </property>
            </activation>
            <distributionManagement>
                <repository>
                    <id>metron-maven-server</id>
                    <url>${release-deployment-url}</url>
                </repository>
                <snapshotRepository>
                    <id>metron-maven-server</id>
                    <url>${snapshot-deployment-url}</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <!-- don't sign for internal releases -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- don't javadoc for internal releases -->
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>glimpse.metsci.com</id>
            <distributionManagement>
                <repository>
                    <id>metron-maven-server</id>
                    <url>${glimpse-release-deployment-url}</url>
                </repository>
                <snapshotRepository>
                    <id>metron-maven-server</id>
                    <url>${glimpse-snapshot-deployment-url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>

</project>
