<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>io.akka</groupId>
    <artifactId>akka-javasdk-parent</artifactId>
    <version>3.7.3</version>
    <packaging>pom</packaging>
    <name>Akka SDK for Java Parent pom</name>
    <description> This is the parent pom for Akka services. It contains all dependencies and plugins to build an Akka service using the Akka SDK for Java. </description>
    <url>https://www.akka.io</url>
    <scm>
        <url>https://github.com/akka/akka-sdk</url>
    </scm>
    <licenses>
        <license>
            <name>BUSL-1.1</name>
            <url>https://raw.githubusercontent.com/akka/akka-sdk/main/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>akka-developers</id>
            <name>Akka SDK Developers</name>
            <url>https://github.com/akka/akka-sdk/graphs/contributors</url>
            <email>akka.official@gmail.com</email>
        </developer>
    </developers>
    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.release>21</maven.compiler.release>
        <!-- keep in sync with
         Makefile#L49
        -->
        <maven.version>3.9.0</maven.version>
        <logback.configurationFile>logback-runtime-dev-mode.xml</logback.configurationFile>
        <docker.image>${project.artifactId}</docker.image>
        <docker.tag>${project.version}-${build.timestamp}</docker.tag>
        <!-- note that this image does never actually run the service in a JVM, it's just a means for distribution -->
        <docker.base.image>us-docker.pkg.dev/kalix-images/infrastructure/alpine:3.24.1</docker.base.image>
        <docker.platform>linux/amd64</docker.platform>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <akka-javasdk.version>3.7.3</akka-javasdk.version>
        <akka.grpc.version>2.5.14</akka.grpc.version>
        <!-- These are dependent on runtime environment and cannot be customized by users -->
        <maven.compiler.release>21</maven.compiler.release>
        <akka-runtime.version>1.7.7</akka-runtime.version>
        <akka-protocol.version>1.1</akka-protocol.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <skip.deploy>true</skip.deploy>
        <non-akka-service>false</non-akka-service>
        <!-- plugin versions -->
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
        <docker-maven-plugin.version>0.45.1</docker-maven-plugin.version>
        <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
        <maven-failsafe-plugin.version>3.1.2</maven-failsafe-plugin.version>
        <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
        <maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
        <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
        <protobuf-java.version>3.25.9</protobuf-java.version>
        <jackson.version>2.22.4</jackson.version>
        <jackson-annotations.version>2.22</jackson-annotations.version>
        <junit-jupiter.version>6.1.3</junit-jupiter.version>
    </properties>
    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.1</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <compilerArgs>
                            <arg>-Xlint:deprecation</arg>
                            <arg>-parameters</arg>
                            <arg>-Aakka.javasdk.groupId=${project.groupId}</arg>
                            <arg>-Aakka.javasdk.artifactId=${project.artifactId}</arg>
                            <arg>-Aakka.javasdk.componentLibrary=${non-akka-service}</arg>
                        </compilerArgs>
                        <annotationProcessors>
                            <annotationProcessor> akka.javasdk.tooling.processor.ComponentValidationProcessor </annotationProcessor>
                            <annotationProcessor> akka.javasdk.tooling.processor.ComponentAnnotationProcessor </annotationProcessor>
                            <annotationProcessor> akka.javasdk.tooling.processor.InventoryProcessor </annotationProcessor>
                        </annotationProcessors>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>io.akka</groupId>
                                <artifactId>akka-javasdk-annotation-processor</artifactId>
                                <version>${akka-javasdk.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${docker-maven-plugin.version}</version>
                    <configuration>
                        <skip>${non-akka-service}</skip>
                        <images>
                            <image>
                                <name>${docker.image}:%l</name>
                                <build>
                                    <!-- Base Docker image which contains jre-->
                                    <from>${docker.base.image}</from>
                                    <!-- Run as the Alpine built-in non-root "nobody" user (uid/gid 65534) -->
                                    <user>65534</user>
                                    <buildOptions>
                                        <platform>${docker.platform}</platform>
                                    </buildOptions>
                                    <tags>
                                        <!-- tag for generated image -->
                                        <tag>${docker.tag}</tag>
                                    </tags>
                                    <!-- image metadata for SDK and runtime compatibility checks -->
                                    <labels>
                                        <io.akka.sdk.version>${akka-javasdk.version}</io.akka.sdk.version>
                                        <io.akka.sdk.expected-runtime>${akka-runtime.version}</io.akka.sdk.expected-runtime>
                                        <io.akka.sdk.protocol>${akka-protocol.version}</io.akka.sdk.protocol>
                                    </labels>
                                    <assembly>
                                        <inline>
                                            <dependencySets>
                                                <dependencySet>
                                                    <outputDirectory>.</outputDirectory>
                                                    <useProjectArtifact>true</useProjectArtifact>
                                                    <scope>compile</scope>
                                                    <excludes>
                                                        <!-- Dependencies of SDK and or available as API for users
                                                             but already provided by runtime. Since runtime versions
                                                             will always be preferred, there is no need to package up
                                                             these.

                                                             Avoid using wildcards here, since those may easily block
                                                             inclusion of jars not provided by the runtime.

                                                             List can be verified by building a runtime image and cross-
                                                             referencing the list of packaged jars.

                                                             Watch out for this log from mvn clean install:
                                                               [WARNING] The following patterns were never triggered in this artifact exclusion filter

                                                             Debug logging can be enabled with:
                                                             mvn clean install -DskipTests -Dorg.slf4j.simpleLogger.showLogName=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.assembly.archive.phase.DependencySetAssemblyPhase=debug
                                                             -->
                                                        <exclude>com.typesafe:config</exclude>
                                                        <exclude>com.typesafe.akka:akka-actor_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-discovery_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-parsing_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-pki_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-protobuf-v3_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-stream_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-http-core_2.13</exclude>
                                                        <exclude>com.typesafe.akka:akka-http_2.13</exclude>
                                                        <exclude>com.hierynomus:asn-one</exclude>
                                                        <exclude>org.reactivestreams:reactive-streams</exclude>
                                                        <!-- Scala stdlib -->
                                                        <exclude>org.scala-lang.modules:scala-collection-compat_2.13</exclude>
                                                        <exclude>org.scala-lang:scala-library</exclude>
                                                        <!-- Protobuf/gRPC
                                                            Note: scalapb validation is still provided from with service (for now) -->
                                                        <exclude>com.thesamet.scalapb:lenses_2.13</exclude>
                                                        <exclude>com.thesamet.scalapb:scalapb-runtime_2.13</exclude>
                                                        <exclude>io.grpc:grpc-stub</exclude>
                                                        <exclude>io.grpc:grpc-api</exclude>
                                                        <exclude>io.grpc:grpc-core</exclude>
                                                        <exclude>io.grpc:grpc-netty-shaded</exclude>
                                                        <exclude>io.grpc:grpc-protobuf</exclude>
                                                        <exclude>com.google.protobuf:protobuf-java</exclude>
                                                        <exclude>com.google.api.grpc:proto-google-common-protos</exclude>
                                                        <exclude>com.lightbend.akka.grpc:akka-grpc-runtime_2.13</exclude>
                                                        <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
                                                        <!-- guava and related -->
                                                        <exclude>com.google.guava:guava</exclude>
                                                        <exclude>com.google.guava:failureaccess</exclude>
                                                        <exclude>com.google.guava:listenablefuture</exclude>
                                                        <exclude>com.google.errorprone:error_prone_annotations</exclude>
                                                        <exclude>com.google.code.findbugs:jsr305</exclude>
                                                        <exclude>org.checkerframework:checker-qual</exclude>
                                                        <exclude>com.google.j2objc:j2objc-annotations</exclude>
                                                        <!-- open telemetry -->
                                                        <exclude>io.opentelemetry:opentelemetry-api</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-context</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-sdk</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-sdk-common</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-sdk-logs</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-sdk-metrics</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-sdk-trace</exclude>
                                                        <exclude>io.opentelemetry:opentelemetry-exporter-otlp</exclude>
                                                        <exclude>io.opentelemetry.semconv:opentelemetry-semconv</exclude>
                                                        <!-- logging -->
                                                        <exclude>org.slf4j:slf4j-api</exclude>
                                                        <exclude>ch.qos.logback:logback-classic</exclude>
                                                        <exclude>ch.qos.logback:logback-core</exclude>
                                                        <exclude>ch.qos.logback.contrib:logback-json-classic</exclude>
                                                        <exclude>ch.qos.logback.contrib:logback-json-core</exclude>
                                                        <exclude>ch.qos.logback.contrib:logback-jackson</exclude>
                                                        <!-- serialization/jackson -->
                                                        <exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
                                                        <exclude>com.fasterxml.jackson.core:jackson-core</exclude>
                                                        <exclude>com.fasterxml.jackson.core:jackson-databind</exclude>
                                                        <exclude>com.fasterxml.jackson.datatype:jackson-datatype-jdk8</exclude>
                                                        <exclude>com.fasterxml.jackson.datatype:jackson-datatype-jsr310</exclude>
                                                        <exclude>com.fasterxml.jackson.module:jackson-module-parameter-names</exclude>
                                                        <!-- SDK spi -->
                                                        <exclude>io.akka:akka-sdk-spi_2.13</exclude>
                                                        <!-- langchain -->
                                                        <exclude>dev.langchain4j:langchain4j</exclude>
                                                    </excludes>
                                                </dependencySet>
                                            </dependencySets>
                                        </inline>
                                    </assembly>
                                    <entryPoint>
                                        <shell>echo &quot;Listing dependencies copied:&quot;; cp --verbose /maven/*.jar /opt/local-lib/</shell>
                                    </entryPoint>
                                </build>
                            </image>
                        </images>
                    </configuration>
                    <executions>
                        <execution>
                            <id>build-docker-image</id>
                            <phase>install</phase>
                            <goals>
                                <goal>build</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                    <executions>
                        <!-- configure src/it/java and src/it/resources legacy paths for integration tests -->
                        <execution>
                            <id>add-integration-test-source</id>
                            <phase>generate-test-sources</phase>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/it/java</source>
                                </sources>
                            </configuration>
                        </execution>
                        <execution>
                            <id>add-integration-test-resource</id>
                            <phase>generate-test-resources</phase>
                            <goals>
                                <goal>add-test-resource</goal>
                            </goals>
                            <configuration>
                                <resources>
                                    <resource>
                                        <directory>${basedir}/src/it/resources</directory>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                        <!-- add generated protobuf and gRPC sources so that IntelliJ finds them automatically -->
                        <execution>
                            <id>add-java-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.build.directory}/generated-sources/akka-grpc-java</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <excludes>
                            <!-- ignore integration test classes -->
                            <exclude>**/*IntegrationTest</exclude>
                        </excludes>
                        <systemPropertyVariables>
                            <logback.configurationFile>${logback.configurationFile}</logback.configurationFile>
                            <akka.javasdk.dev-mode.project-artifact-id>${project.artifactId}</akka.javasdk.dev-mode.project-artifact-id>
                            <akka.javasdk.dev-mode.project-group-id>${project.groupId}</akka.javasdk.dev-mode.project-group-id>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                            <configuration>
                                <includes>
                                    <include>**/*IntegrationTest.java</include>
                                    <include>**/*IT.java</include>
                                    <include>**/IT*.java</include>
                                    <include>**/*ITCase.java</include>
                                </includes>
                                <argLine>-Dlogback.configurationFile=${logback.configurationFile} -Dakka.javasdk.dev-mode.project-artifact-id=${project.artifactId} -Dakka.javasdk.dev-mode.project-group-id=${project.groupId}</argLine>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                    <configuration>
                        <skip>${skip.deploy}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>3.4.1</version>
                    <configuration>
                        <skip>${non-akka-service}</skip>
                        <mainClass>kalix.runtime.AkkaRuntimeMain</mainClass>
                        <cleanupDaemonThreads>false</cleanupDaemonThreads>
                        <systemProperties>
                            <systemProperty>
                                <key>akka.javasdk.dev-mode.enabled</key>
                                <value>true</value>
                            </systemProperty>
                            <systemProperty>
                                <key>logback.configurationFile</key>
                                <value>${logback.configurationFile}</value>
                            </systemProperty>
                            <systemProperty>
                                <key>akka.javasdk.dev-mode.project-artifact-id</key>
                                <value>${project.artifactId}</value>
                            </systemProperty>
                            <systemProperty>
                                <key>akka.javasdk.dev-mode.project-group-id</key>
                                <value>${project.groupId}</value>
                            </systemProperty>
                        </systemProperties>
                    </configuration>
                </plugin>
                <!-- Logs that no Docker image is built for a project with non-akka-service set to true. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>log-no-docker-image</id>
                            <phase>install</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <target xmlns:if="ant:if">
                                    <condition property="log.no.docker.image">
                                        <and>
                                            <istrue value="${non-akka-service}"/>
                                            <not>
                                                <equals arg1="${project.packaging}" arg2="pom"/>
                                            </not>
                                        </and>
                                    </condition>
                                    <echo level="info" if:set="log.no.docker.image" message="The build does not create a Docker image for ${project.groupId}:${project.artifactId} because it is a component library (non-akka-service is true)."/>
                                </target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
            </plugin>
            <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-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <dependencies>
                    <dependency>
                        <groupId>io.akka</groupId>
                        <artifactId>akka-javasdk-enforcer</artifactId>
                        <version>${akka-javasdk.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.akka</groupId>
                        <artifactId>akka-runtime-dependencies</artifactId>
                        <version>${akka-runtime.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>enforce-build-rules</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <akkaRuntimeDependencyCheck>
                                    <failOnConflict>true</failOnConflict>
                                    <versionStrictness>newer-only</versionStrictness>
                                </akkaRuntimeDependencyCheck>
                                <requireMavenVersion>
                                    <version>[3.9.0,)</version>
                                    <message>You must use Maven 3.9.0 or higher to build this project! See https://doc.akka.io/getting-started/starthere.html</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>[21,)</version>
                                    <message>This project requires Java 21 or higher! See https://doc.akka.io/getting-started/starthere.html</message>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>formatting</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.hubspot.maven.plugins</groupId>
                        <artifactId>prettier-maven-plugin</artifactId>
                        <version>0.22</version>
                        <configuration>
                            <prettierJavaVersion>2.6.0</prettierJavaVersion>
                            <printWidth>94</printWidth>
                            <tabWidth>2</tabWidth>
                            <useTabs>false</useTabs>
                            <ignoreConfigFile>true</ignoreConfigFile>
                            <ignoreEditorConfig>true</ignoreEditorConfig>
                            <inputGlobs>
                                <!-- These are the default patterns, you can omit <inputGlobs> entirely unless you want to override them -->
                                <inputGlob>src/main/java/**/*.java</inputGlob>
                                <inputGlob>src/test/java/**/*.java</inputGlob>
                            </inputGlobs>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>write</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Clean build output with a stale component descriptor or inventory: a service without a
             descriptor, a descriptor with a service marker that does not match non-akka-service, a
             descriptor or inventory that another tool wrote after the last Maven compile, or a descriptor
             with components but no inventory, as build output from an earlier SDK has. This happens with
             build output from an earlier SDK version, after a change of non-akka-service, or after an IDE build.
             Maven profile file-based activation does not support wildcards or ${project.*}
             properties, so we use antrun instead. The profile only
             activates when target/classes already exists (previous build output present). -->
        <profile>
            <id>clean-on-stale-descriptor</id>
            <activation>
                <file>
                    <exists>target/classes</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>${maven-antrun-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>clean-on-stale-descriptor</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target xmlns:if="ant:if">
                                        <property name="descriptor.file" value="META-INF/akka-javasdk-components_${project.groupId}_${project.artifactId}.conf"/>
                                        <property name="inventory.file" value="META-INF/akka-javasdk-inventory_${project.groupId}_${project.artifactId}.json"/>
                                        <condition property="descriptor.marker.expected" value="false" else="true">
                                            <istrue value="${non-akka-service}"/>
                                        </condition>
                                        <macrodef name="clean-on-stale-descriptor">
                                            <attribute name="dir"/>
                                            <attribute name="status-file"/>
                                            <attribute name="clean-when-missing"/>
                                            <sequential>
                                                <local name="descriptor.present"/>
                                                <local name="descriptor.marked"/>
                                                <local name="status.present"/>
                                                <local name="status.uptodate"/>
                                                <local name="descriptor.components"/>
                                                <local name="inventory.present"/>
                                                <local name="descriptor.stale"/>
                                                <available property="descriptor.present" file="@{dir}/${descriptor.file}"/>
                                                <available property="status.present" file="@{status-file}"/>
                                                <available property="inventory.present" file="@{dir}/${inventory.file}"/>
                                                <uptodate property="status.uptodate" targetfile="@{status-file}">
                                                    <srcfiles dir="@{dir}" includes="${descriptor.file},${inventory.file}" erroronmissingdir="false"/>
                                                </uptodate>
                                                <condition property="descriptor.marked" value="true" else="false">
                                                    <resourcecount when="greater" count="0">
                                                        <fileset dir="@{dir}" includes="${descriptor.file}" erroronmissingdir="false">
                                                            <containsregexp expression="service\s*=\s*true"/>
                                                        </fileset>
                                                    </resourcecount>
                                                </condition>
                                                <condition property="descriptor.components">
                                                    <resourcecount when="greater" count="0">
                                                        <fileset dir="@{dir}" includes="${descriptor.file}" erroronmissingdir="false">
                                                            <containsregexp expression="components\s*\{"/>
                                                        </fileset>
                                                    </resourcecount>
                                                </condition>
                                                <condition property="descriptor.stale">
                                                    <or>
                                                        <and>
                                                            <not>
                                                                <isset property="descriptor.present"/>
                                                            </not>
                                                            <istrue value="@{clean-when-missing}"/>
                                                        </and>
                                                        <and>
                                                            <isset property="descriptor.present"/>
                                                            <not>
                                                                <equals arg1="${descriptor.marked}" arg2="${descriptor.marker.expected}"/>
                                                            </not>
                                                        </and>
                                                        <and>
                                                            <isset property="status.present"/>
                                                            <not>
                                                                <isset property="status.uptodate"/>
                                                            </not>
                                                        </and>
                                                        <and>
                                                            <isset property="descriptor.components"/>
                                                            <not>
                                                                <isset property="inventory.present"/>
                                                            </not>
                                                        </and>
                                                    </or>
                                                </condition>
                                                <delete dir="@{dir}" if:set="descriptor.stale"/>
                                            </sequential>
                                        </macrodef>
                                        <clean-on-stale-descriptor dir="target/classes" status-file="target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" clean-when-missing="${descriptor.marker.expected}"/>
                                        <clean-on-stale-descriptor dir="target/test-classes" status-file="target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst" clean-when-missing="false"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>generate-protobuf-endpoints</id>
            <activation>
                <file>
                    <exists>src/main/proto</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <!-- Note: Order of plugins is significant since they bind to the same phase -->
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-proto-dependencies</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <!--  We include the core "google/protobuf/*" proto message types out of the box -->
                                        <artifactItem>
                                            <groupId>com.google.protobuf</groupId>
                                            <artifactId>protobuf-java</artifactId>
                                            <version>${protobuf-java.version}</version>
                                            <type>jar</type>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/proto</outputDirectory>
                                            <includes>**/*.proto</includes>
                                        </artifactItem>
                                    </artifactItems>
                                    <overWriteReleases>false</overWriteReleases>
                                    <overWriteSnapshots>true</overWriteSnapshots>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.lightbend.akka.grpc</groupId>
                        <artifactId>akka-grpc-maven-plugin</artifactId>
                        <version>${akka.grpc.version}</version>
                        <configuration>
                            <generatorSettings>
                                <!-- required to generate the instance-per-request handler -->
                                <generateScalaHandlerFactory>true</generateScalaHandlerFactory>
                                <blockingApis>true</blockingApis>
                                <includeStdTypes>true</includeStdTypes>
                            </generatorSettings>
                            <protoPaths>
                                <protoPath>src/main/proto</protoPath>
                                <protoPath>target/proto</protoPath>
                            </protoPaths>
                        </configuration>
                        <!-- Hook the generate goal into the lifecycle, automatically tied to generate-sources -->
                        <executions>
                            <execution>
                                <id>generate-grpc-and-protobuf-sources</id>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <!-- Note: needed - also includes some classes that the messages depend on -->
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                    <version>${protobuf-java.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>standalone</id>
            <properties>
                <docker.base.image>eclipse-temurin:25.0.5_8-jre-resolute</docker.base.image>
            </properties>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>io.akka</groupId>
                        <artifactId>akka-runtime-core_2.13</artifactId>
                        <version>${akka-runtime.version}</version>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>io.akka</groupId>
                    <artifactId>akka-runtime-core_2.13</artifactId>
                </dependency>
            </dependencies>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>io.fabric8</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <version>${docker-maven-plugin.version}</version>
                            <configuration combine.self="override">
                                <skip>${non-akka-service}</skip>
                                <images>
                                    <image>
                                        <name>${docker.image}:%l</name>
                                        <build>
                                            <!-- Base Docker image which contains jre-->
                                            <from>${docker.base.image}</from>
                                            <buildOptions>
                                                <platform>${docker.platform}</platform>
                                            </buildOptions>
                                            <tags>
                                                <!-- tag for generated image -->
                                                <tag>${docker.tag}</tag>
                                            </tags>
                                            <!-- image metadata for SDK and runtime compatibility checks -->
                                            <labels>
                                                <io.akka.sdk.version>${akka-javasdk.version}</io.akka.sdk.version>
                                                <io.akka.sdk.expected-runtime>${akka-runtime.version}</io.akka.sdk.expected-runtime>
                                                <io.akka.sdk.protocol>${akka-protocol.version}</io.akka.sdk.protocol>
                                            </labels>
                                            <entryPoint>
                                                <exec>
                                                    <arg>java</arg>
                                                    <arg>-cp</arg>
                                                    <arg>/maven/*</arg>
                                                    <arg>-Dconfig.resource=runtime-standalone.conf</arg>
                                                    <arg>kalix.runtime.AkkaRuntimeMain</arg>
                                                </exec>
                                            </entryPoint>
                                            <assembly>
                                                <descriptorRef>artifact-with-dependencies</descriptorRef>
                                            </assembly>
                                        </build>
                                    </image>
                                </images>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>build-docker-image</id>
                                    <phase>install</phase>
                                    <goals>
                                        <goal>build</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>pom-packaging</id>
            <activation>
                <file>
                    <!--
                    POMs without a source directory are typically a pom aggregator
                     for those projects we can skip docker and run configuration
                    -->
                    <missing>src</missing>
                </file>
            </activation>
            <properties>
                <non-akka-service>true</non-akka-service>
            </properties>
        </profile>
    </profiles>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.akka</groupId>
                <artifactId>akka-javasdk</artifactId>
                <version>${akka-javasdk.version}</version>
            </dependency>
            <dependency>
                <groupId>io.akka</groupId>
                <artifactId>akka-javasdk-testkit</artifactId>
                <version>${akka-javasdk.version}</version>
            </dependency>
            <!-- Align the SPI with the runtime version rather than the one the SDK was built against.
                 In production the runtime provides the SPI (it is excluded from the service image above),
                 so pinning it here makes -Dakka-runtime.version reproduce that binding locally and surface
                 SPI incompatibilities during development. -->
            <dependency>
                <groupId>io.akka</groupId>
                <artifactId>akka-sdk-spi_2.13</artifactId>
                <version>${akka-runtime.version}</version>
            </dependency>
            <dependency>
                <groupId>io.akka</groupId>
                <artifactId>akka-runtime-dev_2.13</artifactId>
                <version>${akka-runtime.version}</version>
            </dependency>
            <!-- The runtime provides Jackson, and its version takes precedence on the deployed
                 classpath. Hold the whole module family at that version so that a transitive
                 dependency, such as a langchain4j model provider, cannot pull a service onto a
                 newer Jackson than the runtime can load. -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson-annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-parameter-names</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-scala_2.13</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <!-- The testkit brings JUnit. Hold every JUnit artifact at the testkit version so that a
                 test library, such as mockito-junit-jupiter, cannot pull in an older junit-jupiter-api.
                 Mixed JUnit versions make surefire and failsafe fail before they run any test. -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit-jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.akka</groupId>
            <artifactId>akka-javasdk</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.akka</groupId>
            <artifactId>akka-javasdk-testkit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.akka</groupId>
            <artifactId>akka-runtime-dev_2.13</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
</project>