<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.scijava</groupId>
		<artifactId>pom-scijava</artifactId>
		<version>45.1.0</version>
	</parent>

	<groupId>sc.fiji</groupId>
	<artifactId>ome-zarr-java</artifactId>
	<version>0.7.2</version>
	<packaging>pom</packaging>

	<name>OME-Zarr support for Java and FIJI</name>
	<description>Aggregator for the OME-Zarr imglib2 core, N5/zarr-java backends,
		and Fiji integration artifacts.
	</description>
	<url>https://github.com/BioImageTools/ome-zarr-fiji-java</url>

	<inceptionYear>2022</inceptionYear>

	<licenses>
		<license>
			<name>Simplified BSD License</name>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<organization>
		<name>SciJava</name>
		<url>https://scijava.org/</url>
	</organization>

	<developers>
		<developer>
			<id>stefanhahmann</id>
			<name>Stefan Hahmann</name>
			<email>hahmann@mpi-cbg.de</email>
			<url>https://imagej.net/people/stefanhahmann</url>
			<organization>MPI CBG</organization>
			<organizationUrl>https://www.mpi-cbg.de/</organizationUrl>
			<roles>
				<role>lead</role>
				<role>developer</role>
				<role>debugger</role>
				<role>reviewer</role>
				<role>support</role>
				<role>maintainer</role>
			</roles>
		</developer>
		<developer>
			<id>xulman</id>
			<name>Vladimir Ulman</name>
			<url>https://imagej.net/people/xulman</url>
			<roles>
				<role>founder</role>
				<role>lead</role>
				<role>developer</role>
				<role>debugger</role>
				<role>reviewer</role>
				<role>support</role>
				<role>maintainer</role>
			</roles>
		</developer>
		<developer>
			<id>tpietzsch</id>
			<name>Tobias Pietzsch</name>
			<email>pietzsch@mpi-cbg.de</email>
			<url>https://imagej.net/User:Pietzsch</url>
			<roles>
				<role>developer</role>
				<role>reviewer</role>
			</roles>
		</developer>
		<developer>
			<id>tischi</id>
			<name>Christian Tischer</name>
			<roles>
				<role>lead</role>
				<role>support</role>
			</roles>
		</developer>
	</developers>

	<contributors>
		<!-- NB: Need at least one element to override the parent. See: https://issues.apache.org/jira/browse/MNG-5220 -->
		<contributor>
			<name>None</name>
		</contributor>
	</contributors>

	<mailingLists>
		<mailingList>
			<name>Image.sc Forum</name>
			<archive>https://forum.image.sc/tag/ome-zarr</archive>
		</mailingList>
	</mailingLists>

	<!-- ====================================== -->

	<scm>
		<connection>scm:git:git://github.com/BioImageTools/ome-zarr-fiji-java</connection>
		<developerConnection>scm:git:git@github.com:BioImageTools/ome-zarr-fiji-java</developerConnection>
		<tag>ome-zarr-java-0.7.2</tag>
		<url>https://github.com/BioImageTools/ome-zarr-fiji-java</url>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/BioImageTools/ome-zarr-fiji-java/issues</url>
	</issueManagement>
	<ciManagement>
		<system>GitHub Actions</system>
		<url>https://github.com/BioImageTools/ome-zarr-fiji-java/actions</url>
	</ciManagement>

	<!-- ====================================== -->

	<modules>
		<module>ome-zarr-imglib2</module>
		<module>ome-zarr-n5</module>
		<module>ome-zarr-zarrjava</module>
		<module>ome-zarr-fiji</module>
		<module>ome-zarr-fiji-ui</module>
	</modules>

	<!-- ====================================== -->

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

		<package-name>ome.zarr</package-name>

		<license.licenseName>bsd_2</license.licenseName>
		<license.projectName>OME-Zarr extras for Fiji</license.projectName>
		<license.organizationName>SciJava</license.organizationName>
		<license.copyrightOwners>SciJava developers</license.copyrightOwners>
		<license.excludes>**/zarr.json</license.excludes>

		<!-- NB: Parent pom-scijava sets Java 11. We override it here to stay compatible with FIJI stable / Java 8. -->
		<scijava.jvm.version>8</scijava.jvm.version>
		<scijava.jvm.build.version>[1.8.0-101,)</scijava.jvm.build.version>
		<!-- Use older versions of dependencies to stay compatible with FIJI stable / Java 8. -->
		<bigdataviewer-core.version>10.6.8</bigdataviewer-core.version>
		<scifio.version>0.48.0</scifio.version>

		<zarr-java.version>0.1.3</zarr-java.version>

		<sonar.host.url>https://sonarcloud.io</sonar.host.url>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
		<sonar.coverage.jacoco.xmlReportPaths>
			${maven.multiModuleProjectDirectory}/ome-zarr-coverage-report/target/site/jacoco-aggregate/jacoco.xml
		</sonar.coverage.jacoco.xmlReportPaths>
		<sonar.language>java</sonar.language>
		<sonar.verbose>false</sonar.verbose>
	</properties>

	<repositories>
		<repository>
			<id>scijava.public</id>
			<url>https://maven.scijava.org/content/groups/public</url>
		</repository>
		<!-- NB: Temporary (2026-08-28). The `public` group 404s artifacts since the maven.scijava.org downtime, so the -->
		<!-- two hosted repos behind it are listed directly: `releases` (SciJava/ImgLib2/N5) and `thirdparty` -->
		<!-- (cisd:jhdf5, via n5-universe -> n5-hdf5). Additive - keep the group, it also aggregates proxies. Drop -->
		<!-- both once the group serves imglib2-cache-1.0.0-beta-20.pom and jhdf5-19.04.1.pom again. -->
		<repository>
			<id>scijava.releases</id>
			<url>https://maven.scijava.org/repository/releases</url>
		</repository>
		<repository>
			<id>scijava.thirdparty</id>
			<url>https://maven.scijava.org/repository/thirdparty</url>
		</repository>
		<!-- NB: The repos below replace proxies that scijava.public no longer has: its Nexus now exposes only the three -->
		<!-- hosted repos above (`/service/rest/v1/repositories` lists no proxy and no group), so every artifact that -->
		<!-- used to arrive through the group's proxies has to be fetched from its own upstream. Unidata serves -->
		<!-- edu.ucar:cdm-core (via dev.zarr:zarr-java), OME serves ome:formats-gpl / ome:turbojpeg and BeDataDriven -->
		<!-- serves org.renjin:* (both via sc.fiji:fiji, test scope). Keep these even after the group recovers - they -->
		<!-- are the canonical sources. -->
		<repository>
			<id>unidata-all</id>
			<name>Unidata All</name>
			<url>https://artifacts.unidata.ucar.edu/repository/unidata-all/</url>
		</repository>
		<repository>
			<id>ome</id>
			<name>OME Artifactory</name>
			<url>https://artifacts.openmicroscopy.org/artifactory/maven</url>
		</repository>
		<repository>
			<id>bedatadriven</id>
			<name>BeDataDriven Public Repository</name>
			<url>https://nexus.bedatadriven.com/content/groups/public/</url>
		</repository>
	</repositories>

	<!-- ====================================== -->

	<dependencyManagement>
		<dependencies>
			<!-- Internal modules: single source of truth for the shared reactor version. -->
			<dependency>
				<groupId>sc.fiji</groupId>
				<artifactId>ome-zarr-imglib2</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>sc.fiji</groupId>
				<artifactId>ome-zarr-n5</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>sc.fiji</groupId>
				<artifactId>ome-zarr-zarrjava</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>sc.fiji</groupId>
				<artifactId>ome-zarr-fiji</artifactId>
				<version>${project.version}</version>
			</dependency>

			<!-- Not managed by pom-scijava. -->
			<dependency>
				<groupId>dev.zarr</groupId>
				<artifactId>zarr-java</artifactId>
				<version>${zarr-java.version}</version>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>5.23.0</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<!-- Test dependencies shared by every module (all modules test with JUnit 5 -->
	<!-- and use the shared logback-test.xml from test-shared/resources). -->
	<dependencies>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-core</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- ====================================== -->

	<build>
		<!-- ZarrTestUtils and the sample OME-Zarr datasets live once, under -->
		<!-- test-shared/, and are wired into every module's test build below. -->
		<!-- ZarrTestUtils.resourcePath() resolves resources to a real filesystem -->
		<!-- Path, so the data must be copied into each module's target/test-classes -->
		<!-- (a test-jar would expose them only as jar: URLs, which Paths.get rejects). -->
		<testResources>
			<testResource>
				<directory>${project.basedir}/../test-shared/resources</directory>
			</testResource>
			<testResource>
				<directory>${project.basedir}/src/test/resources</directory>
			</testResource>
		</testResources>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-shared-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.basedir}/../test-shared/java</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!-- Run tests in a single forked JVM so -Xmx4g takes effect (macOS CI -->
				<!-- runners OOM otherwise). -da avoids a bigdataviewer-core assertion bug: -->
				<!-- https://github.com/bigdataviewer/bigdataviewer-core/pull/217 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<forkCount>1</forkCount>
						<reuseForks>true</reuseForks>
						<argLine>-Xmx4g -da -Dimagej.legacy.disable=true</argLine>
					</configuration>
				</plugin>
				<!-- Force javadoc onto the classpath instead of the JPMS module path. -->
				<!-- All modules share the ome.zarr base package, so in modular mode the -->
				<!-- plugin collapses them into a single "ome.zarr" module and drops the -->
				<!-- reactor-sibling jar (e.g. ome-zarr-imglib2), making its packages -->
				<!-- invisible to dependent modules ("package ome.zarr.imglib2 does not -->
				<!-- exist"). legacyMode keeps the pre-JPMS classpath behaviour. -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<configuration>
						<legacyMode>true</legacyMode>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>coverage</id>
			<!-- Only pull the aggregate-coverage module into the reactor when measuring -->
			<!-- coverage, so normal builds and releases do not build it. It depends on -->
			<!-- all five modules, so it is built last and can read their jacoco.exec. -->
			<modules>
				<module>ome-zarr-coverage-report</module>
			</modules>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<forkCount>1</forkCount>
							<reuseForks>true</reuseForks>
							<argLine>@{argLine} -Xmx4g -da</argLine>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.7</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>report</id>
								<goals>
									<goal>report</goal>
								</goals>
								<configuration>
									<formats>
										<format>XML</format>
									</formats>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
