<!--
  ~ Copyright 2024 REGnosys
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>9</version>
    </parent>

    <groupId>com.regnosys.rosetta</groupId>
    <artifactId>com.regnosys.rosetta.parent</artifactId>
    <version>9.64.0</version>
    <packaging>pom</packaging>

    <name>Rosetta DSL Parent POM</name>
    <description>
        Rosetta is a Domain-Specific Language (DSL) that supports the modelling
        of operational processes for the
        financial markets' industry. Its purpose is to promote consistency and
        inter-operability between the various
        implementations of these processes.

        This parent project manages dependencies of the modules that make up the
        Rosetta DSL.
    </description>
    <url>https://github.com/finos/rune-dsl</url>

    <organization>
        <name>REGnosys</name>
        <url>https://regnosys.com/</url>
    </organization>

    <scm>
        <url>https://github.com/finos/rune-dsl</url>
        <connection>scm:git:https://github.com/finos/rune-dsl.git</connection>
        <developerConnection>scm:git:ssh://github.com/finos/rune-dsl.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/finos/rune-dsl/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

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

    <developers>
        <developer>
            <id>SimonCockx</id>
            <name>Simon Cockx</name>
            <email>infra@regnosys.com</email>
            <url>http://github.com/SimonCockx</url>
            <organization>REGnosys</organization>
            <organizationUrl>https://regnosys.com</organizationUrl>
            <timezone>Europe/Brussels</timezone>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <java.enforced.version>[21,22)</java.enforced.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Release -->
        <distMgmtReleaseName>REGnosys Release Distribution Repository</distMgmtReleaseName>
        <distMgmtSnapshotsName>REGnosys Development Snapshot Repository</distMgmtSnapshotsName>
        <organization.logo>https://regnosys.com/assets/images/common/logo.png</organization.logo>

        <!-- Dependency management -->
        <xtext.version>2.38.0</xtext.version>
        <commons-lang3.version>3.14.0</commons-lang3.version>
        <commons-text.version>1.12.0</commons-text.version>
        <snakeyaml.version>2.2</snakeyaml.version>
        <org.eclipse.emf.ecore.xcore.lib.version>1.7.0</org.eclipse.emf.ecore.xcore.lib.version>
        <maven-plugin-api.version>3.9.8</maven-plugin-api.version>
        <maven-core.version>3.9.8</maven-core.version>
        <maven-plugin-annotations.version>3.13.1</maven-plugin-annotations.version>
        <slf4j.version>2.0.13</slf4j.version>
        <logback.version>1.5.6</logback.version>
        <InMemoryJavaCompiler.version>1.3.0</InMemoryJavaCompiler.version>
        <jackson.version>2.17.1</jackson.version>

        <!-- test -->
        <junit.version>5.10.2</junit.version>
        <mockito-core.version>5.12.0</mockito-core.version>

        <!-- Plugin and plugin dependency management -->
        <org.eclipse.emf.ecore.xcore.version>1.32.0</org.eclipse.emf.ecore.xcore.version>
        <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
        <maven-checkstyle-plugin.version>3.4.0</maven-checkstyle-plugin.version>
        <exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
        <maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
        <build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
        <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
        <maven-dependency-plugin.version>3.7.0</maven-dependency-plugin.version>
        <maven-surefire-plugin.version>3.3.0</maven-surefire-plugin.version>
        <maven-plugin-plugin.version>3.13.1</maven-plugin-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <addjars-maven-plugin.version>1.0.5</addjars-maven-plugin.version>
        <appassembler-maven-plugin.version>2.1.0</appassembler-maven-plugin.version>
        <frontend-maven-plugin.version>1.15.0</frontend-maven-plugin.version>
        <node.version>22.11.0</node.version>
    </properties>

    <modules>
        <module>rosetta-xcore-plugin-dependencies</module>
        <module>rosetta-runtime</module>
        <module>rosetta-lang</module>
        <module>rosetta-testing</module>
        <module>rosetta-integration-tests</module>
        <module>rosetta-ide</module>
        <module>rosetta-tools</module>
        <module>rosetta-maven-plugin</module>
        <module>rosetta-profiling</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Test dependencies -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xbase.testing</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>

            <!-- Runtime dependencies -->
            <!-- The following dependency can be removed in a next major version
                 once this issue has been addressed: https://github.com/finos/rune-dsl/issues/938 -->
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>6.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>xtext-dev-bom</artifactId>
                <version>${xtext.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext</artifactId>
                <version>${xtext.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>ch.qos.reload4j</groupId>
                        <artifactId>reload4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.ide</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.testing</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xbase</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xbase.lib</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xtext.generator</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.common.types</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.ecore</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.util</artifactId>
                <version>${xtext.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>ch.qos.reload4j</groupId>
                        <artifactId>reload4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtend</groupId>
                <artifactId>org.eclipse.xtend.lib</artifactId>
                <version>${xtext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons-text.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.emf</groupId>
                <artifactId>org.eclipse.emf.ecore.xcore</artifactId>
                <version>${org.eclipse.emf.ecore.xcore.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.eclipse.emf</groupId>
                <artifactId>org.eclipse.emf.ecore.xcore.lib</artifactId>
                <version>${org.eclipse.emf.ecore.xcore.lib.version}</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${maven-plugin-api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${maven-plugin-annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>xtext-maven-plugin</artifactId>
                <version>${xtext.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>ch.qos.reload4j</groupId>
                        <artifactId>reload4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <!-- Xtext uses Log4j directly. The following dependency will
            redirect Log4j messages to slf4j. -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>log4j-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.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.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mdkt.compiler</groupId>
                <artifactId>InMemoryJavaCompiler</artifactId>
                <version>${InMemoryJavaCompiler.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</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>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <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>
                        <sourceDirectory>${project.basedir}/xtend-gen/main/java</sourceDirectory>
                        <sourceDirectory>${project.basedir}/xtend-gen/test/java</sourceDirectory>
                    </sourceDirectories>
                </configuration>
                <executions>
                    <execution>
                        <id>Check style</id>
                        <!-- This needs to run /after/ xtend (test) source
                        generation is done. -->
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-generated-sources-to-build</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src-gen/main/java</source>
                                <source>${project.basedir}/emf-gen/main/java</source>
                                <source>${project.basedir}/xtend-gen/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-generated-test-sources-to-build</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src-gen/test/java</source>
                                <source>${project.basedir}/emf-gen/test/java</source>
                                <source>${project.basedir}/xtend-gen/test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Prevent maven-source-plugin from running twice during a release -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>none</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <skipSource>true</skipSource>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.xtend</groupId>
                    <artifactId>xtend-maven-plugin</artifactId>
                    <version>${xtext.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                                <goal>xtend-install-debug-info</goal>
                                <goal>testCompile</goal>
                                <goal>xtend-test-install-debug-info</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <outputDirectory>
                            ${project.basedir}/xtend-gen/main/java
                        </outputDirectory>
                        <testOutputDirectory>
                            ${project.basedir}/xtend-gen/test/java
                        </testOutputDirectory>
                        <showEmptyDirWarning>false</showEmptyDirWarning>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.xtext</groupId>
                    <artifactId>xtext-maven-plugin</artifactId>
                    <version>${xtext.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.googlecode.addjars-maven-plugin</groupId>
                    <artifactId>addjars-maven-plugin</artifactId>
                    <version>${addjars-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>appassembler-maven-plugin</artifactId>
                    <version>${appassembler-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <nodeVersion>v${node.version}</nodeVersion>
                        <workingDirectory>${project.basedir}/vscode</workingDirectory>
                        <installDirectory>${project.basedir}/target</installDirectory>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<configuration>
						<failOnError>false</failOnError>
					</configuration>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<phase>package</phase>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            exec-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${exec-maven-plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>java</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-enforcer-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${maven-enforcer-plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${maven-dependency-plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-plugin-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${maven-plugin-plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>descriptor</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
