<?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>

    <parent>
        <groupId>org.finos</groupId>
        <artifactId>finos</artifactId>
        <version>7</version>
    </parent>

    <name>FpML as Rune</name>
    <groupId>com.regnosys.rune-fpml</groupId>
    <artifactId>parent</artifactId>
    
    <packaging>pom</packaging>
    <version>1.5.3</version>
    <modules>
        <module>rosetta-source</module>
        <module>tests</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.enforced.version>[21,22)</java.enforced.version>
        <maven.compiler.release>11</maven.compiler.release>
        <rosetta.dsl.version>9.75.3</rosetta.dsl.version>
        <rosetta.bundle.version>11.108.0</rosetta.bundle.version>

        <xtext.version>2.38.0</xtext.version>
        <guice.version>6.0.0</guice.version>
        <guava.version>33.3.1-jre</guava.version>
        <jackson.version>2.18.0</jackson.version>

        <!-- Release -->
        <gpg.keyname>configured-by-release-profile</gpg.keyname>
        <gpg.passphrase>configured-by-release-profile</gpg.passphrase>

        <!-- Test -->
        <junit.version>5.9.1</junit.version>
        <junit-platform-commons.version>1.9.1</junit-platform-commons.version>
        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>5.1.1</mockito.version>
        <xmlunit.version>2.9.1</xmlunit.version>
        <logback.version>1.4.4</logback.version>

        <!-- Plugins -->
        <maven-enforcer-plugin.version>3.2.1</maven-enforcer-plugin.version>
        <maven-checkstyle-plugin.version>3.4.0</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
        <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseEnvName>${gpg.passphrase}</passphraseEnvName>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>none</phase> <!-- Disable this execution -->
                            </execution>
                            <execution>
                                <id>default</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
            <!-- rosetta START -->
            <dependency>
                <groupId>com.regnosys.rosetta</groupId>
                <artifactId>com.regnosys.rosetta.lib</artifactId>
                <version>${rosetta.dsl.version}</version>
            </dependency>
            <dependency>
                <groupId>com.regnosys</groupId>
                <artifactId>rosetta-common</artifactId>
                <version>${rosetta.bundle.version}</version>
            </dependency>
            <!-- rosetta END -->
            <!-- xtext START -->
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>xtext-dev-bom</artifactId>
                <version>${xtext.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- xtext END -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- test -->
            <dependency>
                <groupId>com.regnosys</groupId>
                <artifactId>rosetta-testing</artifactId>
                <version>${rosetta.bundle.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>ch.qos.reload4j</groupId>
                        <artifactId>reload4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-bom</artifactId>
                <version>${mockito.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-core</artifactId>
                <version>${xmlunit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-matchers</artifactId>
                <version>${xmlunit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${java.enforced.version}</version>
                                </requireJavaVersion>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>log4j:log4j</exclude>
                                        <exclude>org.apache.logging.log4j:log4j-core</exclude>
                                        <exclude>ch.qos.reload4j:reload4j</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <sourceDirectories>
                        <sourceDirectory>src/main/java</sourceDirectory>
                        <sourceDirectory>src/test/java</sourceDirectory>
                    </sourceDirectories>
                </configuration>
                <executions>
                    <execution>
                        <id>Check style</id>
                        <!-- This needs to run /after/ (test) source
                        generation is done. -->
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
