<?xml version="1.0" encoding="UTF-8"?>
<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>org.openmicroscopy</groupId>
  <artifactId>pom-bio-formats</artifactId>
  <version>9.0.0-rc5</version>
  <packaging>pom</packaging>

  <name>Bio-Formats projects</name>
  <description>Umbrella project for the Bio-Formats software project.</description>
  <url>https://www.openmicroscopy.org/bio-formats</url>
  <inceptionYear>2005</inceptionYear>

  <licenses>
    <license>
      <name>Simplified BSD License</name>
      <url>https://opensource.org/licenses/BSD-2-Clause</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>GNU General Public License v2+</name>
      <url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <modules>
    <module>components/formats-api</module>
    <module>components/formats-bsd</module>
    <module>components/formats-gpl</module>
    <module>components/bundles/bioformats_package</module>
    <module>components/bio-formats-plugins</module>
    <module>components/bio-formats-tools</module>
    <module>components/test-suite</module>
  </modules>

  <properties>
    <!-- If two artifacts on the classpath use two different versions of the
         same dependency, behavior is inconsistent at best, and often broken.
         The following properties facilitate consistency of dependency
         versions between various projects in the SciJava software stack.
         When possible, we advise using the relevant groupId and version
         properties for your dependencies rather than hardcoding them. -->

    <release.version>9.0.0-rc5</release.version>
    <date>${maven.build.timestamp}</date>
    <year>2017</year>
    <project.rootdir>${basedir}</project.rootdir>
    <imagej1.version>1.54c</imagej1.version>
    <jgoodies-forms.version>1.7.2</jgoodies-forms.version>
    <logback.version>1.5.37</logback.version>
    <ome-stubs.version>6.1.3</ome-stubs.version>
    <mipav-stubs.version>${ome-stubs.version}</mipav-stubs.version>
    <ome-metakit.version>5.5.0</ome-metakit.version>
    <metakit.version>${ome-metakit.version}</metakit.version>
    <slf4j.version>2.0.18</slf4j.version>
    <kryo.version>5.4.0</kryo.version>
    <testng.version>6.8</testng.version>
    <ome-common.version>7.0.0</ome-common.version>
    <ome-model.group>org.openmicroscopy</ome-model.group>
    <ome-model.version>6.7.0</ome-model.version>
    <ome-poi.version>5.5.0</ome-poi.version>
    <ome-mdbtools.version>5.4.1</ome-mdbtools.version>
    <ome-jai.version>0.2.1</ome-jai.version>
    <ome-codecs.version>1.3.0</ome-codecs.version>
    <jxrlib.version>0.2.4</jxrlib.version>
    <xalan.version>2.7.3</xalan.version>
    <sqlite.version>3.49.1.0</sqlite.version>
    <turbojpeg.version>0.1.0</turbojpeg.version>

    <!-- Maven plugin versions -->
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>

    <!-- NB: Avoid platform encoding warning when copying resources. -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- NB: Specify formatting of the maven.build.timestamp property. -->
    <maven.build.timestamp.format>d MMMMM yyyy</maven.build.timestamp.format>

    <!-- NB: Override argLine property for extra maven-surefire-plugin args. -->
    <argLine/>
  </properties>

  <build>
    <!-- It is nice for "mvn" with no arguments to do something reasonable. -->
    <defaultGoal>install</defaultGoal>

    <sourceDirectory>${project.basedir}/src</sourceDirectory>
    <testSourceDirectory>${project.basedir}/test</testSourceDirectory>
    <resources>
      <resource>
        <directory>${project.basedir}/src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
          <exclude>**/package.html</exclude>
          <exclude>**/*.properties</exclude>
        </excludes>
      </resource>
      <resource>
        <targetPath>META-INF/lib</targetPath>
        <directory>${project.basedir}/lib</directory>
      </resource>
      <resource>
        <directory>${project.basedir}/src</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.cpp</include>
        </includes>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${project.basedir}</directory>
        <includes>
          <include>utils/*.cpp</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${project.basedir}/test</directory>
        <excludes>
          <exclude>**/*.java</exclude>
          <exclude>**/package.html</exclude>
        </excludes>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>

      <!-- Create -sources.jar when building. -->
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <!-- Add Implementation-Build entry to JAR manifest. -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>

      <!-- Enable 'license:' goals. -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <licenseName>gpl_v2</licenseName>
          <organizationName>Open Microscopy Environment:
  - Board of Regents of the University of Wisconsin-Madison
  - Glencoe Software, Inc.
  - University of Dundee</organizationName>
            <!-- NB: Avoid stomping on variant copyright holders. -->
            <canUpdateCopyright>false</canUpdateCopyright>
          <roots>
            <root>src</root>
            <root>test</root>
            <root>utils</root>
            <root>doc</root>
          </roots>
        </configuration>
      </plugin>
    </plugins>

    <!-- We use wagon-webdav-jackrabbit 1.0 for deploys, since it is
         compatible with both Maven 2.2.x and Maven 3.0.x cross-platform. -->
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>1.0</version>
      </extension>
    </extensions>

    <pluginManagement>
      <plugins>
        <!-- Enforce minimum maven version -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M2</version>
          <executions>
            <execution>
              <id>enforce-versions</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>[3.0.5,)</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>[1.7,)</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

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

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.14.0</version>
          <!-- Require the Java 11 platform. -->
          <configuration>
            <source>11</source>
            <target>11</target>
            <release>11</release>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>

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

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

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.0</version>
          <!-- Always add classpath to JAR manifests. -->
          <configuration>
            <skipIfEmpty>true</skipIfEmpty>
            <archive>
              <manifest>
                <addClasspath>true</addClasspath>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <!-- Add SCM revision from buildnumber plugin, if available. -->
                <Implementation-Build>${buildNumber}</Implementation-Build>
                <!-- Add a formatted timestamp for the build. -->
                <Implementation-Date>${maven.build.timestamp}</Implementation-Date>
              </manifestEntries>
            </archive>
            <excludes>
              <exclude>**/*.cpp</exclude>
              <exclude>**/*.h</exclude>
            </excludes>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <javadocDirectory>${project.basedir}/src</javadocDirectory>
            <maxmemory>1024m</maxmemory>
            <!-- Workaround for javadoc bug when classes in the default
                 package access classes from non-default packages. See:
                 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5101868 -->
            <use>false</use>
            <links>
              <!-- Java 11 -->
              <link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>

              <!-- ImageJ1 -->
              <link>https://javadoc.scijava.org/net.imagej/ij/${imagej1.version}/</link>
            </links>
          </configuration>
          <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        </plugin>

        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.5.2</version>
        </plugin>

        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.scm</groupId>
              <artifactId>maven-scm-provider-gitexe</artifactId>
              <version>1.9</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.7.1</version>
        </plugin>

        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <!-- Build source artifact in addition to main artifact. -->
          <executions>
            <execution>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.0</version>
          <!-- Make sure that:
               A) unit tests run with sufficient RAM allocated;
               B) unit tests do not pop a Java dock icon on OS X;
               C) additional args can be given via argLine property;

               Sometimes, one needs to pass JVM options to the JVM
               running the unit tests, such as -verbose:class or
               -Djava.awt.headless=true.

               Unfortunately, maven-surefire does not expose a
               command-line interface to do so, therefore let's
               simulate it by re-using the property 'argLine' to
               specify those options. -->
          <configuration>
            <argLine>-Xms512m -Xmx512m -Dapple.awt.UIElement="true" ${argLine}</argLine>
          </configuration>
        </plugin>

        <!-- Build Number Maven plugin -
             http://mojo.codehaus.org/buildnumber-maven-plugin/
             This plugin embeds a build number in the JAR manifest. -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>1.4</version>
          <!-- Record SCM revision in manifest. -->
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
          </configuration>
        </plugin>

        <!-- Exec Maven plugin -
        http://mojo.codehaus.org/exec-maven-plugin/
        This plugin launches a Java class using Maven. -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.6.0</version>
        </plugin>

        <!-- License Maven plugin -
             http://mojo.codehaus.org/license-maven-plugin/
             This plugin manages project licenses and source file headers. -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>1.16</version>
          <configuration>
            <projectName>${project.description}</projectName>
            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
            <canUpdateDescription>true</canUpdateDescription>
            <canUpdateCopyright>true</canUpdateCopyright>
            <extraExtensions>
              <bsh>java</bsh>
              <config>properties</config>
              <ijm>java</ijm>
            </extraExtensions>
          </configuration>
        </plugin>

        <!-- Versions Maven plugin -
             http://mojo.codehaus.org/versions-maven-plugin/
             Check for new plugin versions using
             "mvn versions:display-plugin-updates" -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.5</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <organization>
    <name>Open Microscopy Environment</name>
    <url>https://www.openmicroscopy.org/</url>
  </organization>

  <developers>
    <developer>
      <id>sbesson</id>
      <name>Sébastien Besson</name>
      <email>sbesson@glencoesoftware.com</email>
      <organization>Glencoe Software</organization>
      <organizationUrl>http://glencoesoftware.com/</organizationUrl>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>0</timezone>
    </developer>
    <developer>
      <id>melissa</id>
      <name>Melissa Linkert</name>
      <email>melissa@glencoesoftware.com</email>
      <organization>Glencoe Software</organization>
      <organizationUrl>http://glencoesoftware.com/</organizationUrl>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>-6</timezone>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/ome/bioformats</connection>
    <developerConnection>scm:git:git@github.com:ome/bioformats</developerConnection>
    <tag>HEAD</tag>
    <url>https://github.com/ome/bioformats</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/ome/bioformats/issues</url>
  </issueManagement>
  <ciManagement>
    <system>GitHub</system>
    <url>https://github.com/ome/bioformats/actions</url>
  </ciManagement>


  <!-- NB: for parent project -->
  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
    <repository>
      <id>scijava</id>
      <name>SciJava</name>
      <url>https://maven.scijava.org/content/groups/public/</url>
    </repository>
    <repository>
      <id>ome</id>
      <name>OME Artifactory</name>
      <url>https://artifacts.openmicroscopy.org/artifactory/maven/</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
    </pluginRepository>
  </pluginRepositories>

  <profiles>
    <!-- Run integration tests when "-P run-its" is passed.
         This works using the maven-invoker-plugin. -->
    <profile>
      <id>run-its</id>
      <build>
        <defaultGoal>integration-test</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
              <debug>${invoker.debug}</debug>
              <showErrors>true</showErrors>
              <streamLogs>true</streamLogs>
              <projectsDirectory>src/it</projectsDirectory>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <settingsFile>src/it/settings.xml</settingsFile>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <preBuildHookScript>setup.bsh</preBuildHookScript>
              <postBuildHookScript>verify.bsh</postBuildHookScript>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>only-eclipse</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- Eclipse-specific configuration

                 With a recent version of m2e, Eclipse's Maven
                 binding, it is no longer enough to configure plugins;
                 they will be ignored by default. But we really want
                 the buildnumber and the jar plugin to do their
                 job. So now we have to add lifecycle mappings in
                 addition to configuring the plugins.

                 Let's hope that m2e remains the only IDE Maven
                 binding that requires such a lot of additional work
                 just to get the same result as plain Maven would
                 produce out of the box. -->
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.gmaven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <versionRange>[2.0.6,)</versionRange>
                        <goals>
                          <goal>execute</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>buildnumber-maven-plugin</artifactId>
                        <versionRange>[1.4,)</versionRange>
                        <goals>
                          <goal>create</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <execute>
                          <runOnIncremental>true</runOnIncremental>
                          <runOnConfiguration>true</runOnConfiguration>
                        </execute>
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <versionRange>[3.0.2,)</versionRange>
                        <goals>
                          <goal>jar</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <execute>
                          <runOnIncremental>true</runOnIncremental>
                          <runOnConfiguration>true</runOnConfiguration>
                        </execute>
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>net.imagej</groupId>
                        <artifactId>imagej-maven-plugin</artifactId>
                        <versionRange>[0.6.0,)</versionRange>
                        <goals>
                          <goal>set-rootdir</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>

          <!-- gpg release signing -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.12.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
              <waitMaxTime>3600</waitMaxTime>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
