<?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>cab.ml</groupId>
	<artifactId>juno</artifactId>
	<version>0.1.0</version>
	<packaging>pom</packaging>
	<name>Java Unified Neural Orchestration</name>
	<description>Java Unified Neural Orchestration (Juno) -- distributed LLM
		inference and fine-tuning engine</description>
	<url>https://ml.cab/juno.html</url>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Juno Team</name>
			<organization>Machine Learning Cabinet</organization>
			<organizationUrl>https://ml.cab/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://github.com/ml-cab/juno.git</connection>
		<developerConnection>scm:git:git@github.com:ml-cab/juno.git</developerConnection>
		<url>https://github.com/ml-cab/juno</url>
		<tag>v0.1.0</tag>
	</scm>

	<modules>
		<module>juno-bom</module>
		<module>api</module>
		<!-- core libraries -->
		<module>registry</module>
		<module>coordinator</module>
		<module>lora</module>
		<module>node</module>
		<module>kvcache</module>
		<module>tokenizer</module>
		<module>sampler</module>
		<module>health</module>
		<!-- JFR instrumentation -->
		<module>metrics</module>
		<!-- executables -->
		<module>juno-player</module>
		<module>juno-master</module>
		<module>juno-node</module>
	</modules>
	<properties>
		<!-- Java -->
		<java.version>25</java.version>
		<maven.compiler.release>25</maven.compiler.release>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- Hazelcast -->
		<hazelcast.version>5.4.0</hazelcast.version>
		<!-- gRPC / Protobuf -->
		<grpc.version>1.68.0</grpc.version>
		<protobuf.version>3.25.3</protobuf.version>
		<protobuf-plugin.version>3.11.4</protobuf-plugin.version>
		<!-- GPU: org.bytedeco cuda (JavaCPP presets), works with various NVIDIA
		GPUs; 12.6 runtime compatible with driver 12.x/13.x -->
		<bytedeco.cuda.version>12.6-9.5-1.5.11</bytedeco.cuda.version>
		<!-- DJL / Tokenizer -->
		<djl.version>0.27.0</djl.version>
		<!-- Cache -->
		<caffeine.version>3.1.8</caffeine.version>
		<!-- Resilience -->
		<resilience4j.version>2.2.0</resilience4j.version>
		<!-- Observability -->
		<micrometer.version>1.13.0</micrometer.version>
		<prometheus.version>1.13.0</prometheus.version>
		<!-- Serialization -->
		<flatbuffers.version>24.3.25</flatbuffers.version>
		<!-- Web runtime -->
		<javalin.version>6.3.0</javalin.version>
		<!-- Logging -->
		<slf4j.version>2.0.13</slf4j.version>
		<logback.version>1.5.6</logback.version>
		<!-- Testing -->
		<junit.version>5.10.2</junit.version>
		<mockito.version>5.12.0</mockito.version>
		<assertj.version>3.26.0</assertj.version>
		<!-- Maven plugins -->
		<maven-compiler.version>3.13.0</maven-compiler.version>
		<maven-surefire.version>3.3.0</maven-surefire.version>
		<!-- Jocl version -->
		<jocl-version>2.0.4</jocl-version>
	</properties>
	<dependencyManagement>
		<dependencies>
			<!-- Internal modules -->
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>api</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>registry</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>metrics</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>coordinator</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>lora</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>node</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>node</artifactId>
				<version>${project.version}</version>
				<classifier>tests</classifier>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>kvcache</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>tokenizer</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>sampler</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>health</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>juno-node</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>juno-player</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>cab.ml</groupId>
				<artifactId>juno-master</artifactId>
				<version>${project.version}</version>
			</dependency>
			<!-- Hazelcast -->
			<dependency>
				<groupId>com.hazelcast</groupId>
				<artifactId>hazelcast</artifactId>
				<version>${hazelcast.version}</version>
			</dependency>
			<!-- gRPC -->
			<dependency>
				<groupId>io.grpc</groupId>
				<artifactId>grpc-netty-shaded</artifactId>
				<version>${grpc.version}</version>
			</dependency>
			<dependency>
				<groupId>io.grpc</groupId>
				<artifactId>grpc-protobuf</artifactId>
				<version>${grpc.version}</version>
			</dependency>
			<dependency>
				<groupId>io.grpc</groupId>
				<artifactId>grpc-stub</artifactId>
				<version>${grpc.version}</version>
			</dependency>
			<!-- Protobuf -->
			<dependency>
				<groupId>com.google.protobuf</groupId>
				<artifactId>protobuf-java</artifactId>
				<version>${protobuf.version}</version>
			</dependency>
			<!-- CUDA via JavaCPP presets (org.bytedeco); includes cudart +
			cublas, platform natives -->
			<dependency>
				<groupId>org.bytedeco</groupId>
				<artifactId>cuda-platform</artifactId>
				<version>${bytedeco.cuda.version}</version>
			</dependency>
			<!-- chronicle-map off-heap cache -->
			<dependency>
				<groupId>net.openhft</groupId>
				<artifactId>chronicle-map</artifactId>
				<version>${chronicle-map.version}</version>
			</dependency>
			<!-- Ehcache 3 -->
			<dependency>
				<groupId>org.ehcache</groupId>
				<artifactId>ehcache</artifactId>
				<version>${ehcache.version}</version>
			</dependency>
			<!-- Caffeine -->
			<dependency>
				<groupId>com.github.ben-manes.caffeine</groupId>
				<artifactId>caffeine</artifactId>
				<version>${caffeine.version}</version>
			</dependency>
			<!-- Resilience4j -->
			<dependency>
				<groupId>io.github.resilience4j</groupId>
				<artifactId>resilience4j-circuitbreaker</artifactId>
				<version>${resilience4j.version}</version>
			</dependency>
			<dependency>
				<groupId>io.github.resilience4j</groupId>
				<artifactId>resilience4j-retry</artifactId>
				<version>${resilience4j.version}</version>
			</dependency>
			<!-- Micrometer -->
			<dependency>
				<groupId>io.micrometer</groupId>
				<artifactId>micrometer-core</artifactId>
				<version>${micrometer.version}</version>
			</dependency>
			<dependency>
				<groupId>io.micrometer</groupId>
				<artifactId>micrometer-registry-prometheus</artifactId>
				<version>${prometheus.version}</version>
			</dependency>
			<dependency>
				<groupId>io.javalin</groupId>
				<artifactId>javalin</artifactId>
				<version>${javalin.version}</version>
			</dependency>
			<dependency>
				<groupId>io.prometheus</groupId>
				<artifactId>prometheus-metrics-exporter-httpserver</artifactId>
				<version>1.3.1</version>
			</dependency>
			<!-- Logging -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>${logback.version}</version>
			</dependency>
			<!-- Testing -->
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>${mockito.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-core</artifactId>
				<version>${assertj.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<!-- Common deps for all modules -->
	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire.version}</version>
				</plugin>
				<!-- Sources and Javadoc — required by Maven Central -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.1</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<phase>verify</phase>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.11.2</version>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<phase>verify</phase>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<doclint>none</doclint>
						<failOnError>false</failOnError>
						<quiet>true</quiet>
						<source>${java.version}</source>
						<release>${java.version}</release>
					</configuration>
				</plugin>
				<!-- Protobuf / gRPC code generation -->
				<plugin>
					<groupId>com.github.os72</groupId>
					<artifactId>protoc-jar-maven-plugin</artifactId>
					<version>${protobuf-plugin.version}</version>
					<executions>
						<execution>
							<phase>generate-sources</phase>
							<goals>
								<goal>run</goal>
							</goals>
							<configuration>
								<protocVersion>${protobuf.version}</protocVersion>
								<includeGoogleProtobuf>true</includeGoogleProtobuf>
								<outputTargets>
									<outputTarget>
										<type>java</type>
										<outputDirectory>
											target/generated-sources/protobuf</outputDirectory>
									</outputTarget>
									<outputTarget>
										<type>grpc-java</type>
										<pluginArtifact>
											io.grpc:protoc-gen-grpc-java:${grpc.version}</pluginArtifact>
										<outputDirectory>
											target/generated-sources/grpc</outputDirectory>
									</outputTarget>
								</outputTargets>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<tagNameFormat>v@{project.version}</tagNameFormat>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<pushChanges>false</pushChanges>
					<!-- Tag may exist only locally until origin is pushed -->
					<localCheckout>true</localCheckout>
					<checkModificationExcludes>
						<checkModificationExclude>CLAUDE.md</checkModificationExclude>
					</checkModificationExcludes>
					<arguments>-DskipTests -DskipITs</arguments>
					<goals>install</goals>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<!--
		  Sign primary artifacts during verify (after shade repackage).
		  mvn clean verify -DskipTests -Prelease-sign
		  Requires a GPG secret key and (non-interactive) gpg-agent or
		-Dgpg.passphrase=...
		-->
		<profile>
			<id>release-sign</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.2.7</version>
						<executions>
							<execution>
								<id>sign-release</id>
								<!-- install phase: runs after verify, so sources+javadoc jars
								     produced at verify are already attached and get signed too -->
								<phase>install</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- loopback: allows -Dgpg.passphrase=... without a GUI pinentry -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!--
		  Maven Central (Sonatype Central Portal). Attach sources+javadoc per jar module,
		  then deploy:
		  mvn clean deploy -Prelease-sign -Pcentral-publish -DskipTests
		  settings.xml: server id "central" with portal token (Sonatype Central docs).
		-->
		<profile>
			<id>central-publish</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>0.7.0</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
							<checksums>required</checksums>
							<deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>