<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>
    <parent>
        <groupId>ai.tock</groupId>
        <artifactId>tock-gen-ai</artifactId>
        <version>24.3.2</version>
    </parent>

    <artifactId>tock-gen-ai-orchestrator-server</artifactId>
    <packaging>pom</packaging>

    <name>Tock Gen AI Orchestrator Server</name>

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

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>poetry-to-requirements.txt</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <workingDirectory>src/main/python/server/</workingDirectory>
                    <!--
                        For Linux, the path to this "poetry" script must be declared :
                        - in the PATH defined in the ~/.profile configuration file.
                        - or in a script that launches the maven build
                    -->
                    <executable>poetry</executable>
                    <arguments>
                        <argument>export</argument>
                        <argument>--without-hashes</argument>
                        <argument>--format=requirements.txt</argument>
                        <argument>--output=src/requirements.txt</argument>
                    </arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
