<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.into-cps.maestro</groupId>
    <artifactId>root</artifactId>
    <version>4.0.0</version>
    <packaging>pom</packaging>
    <name>Maestro Root</name>
    <description>This is a FMI simulation framework</description>
    <url>https://github.com/INTO-CPS-Association/maestro</url>


    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <log4j2.version>2.24.3</log4j2.version>
        <fmu.api.version>1.5.0</fmu.api.version>
        <maestro.v1.version>1.0.10</maestro.v1.version>
        <kotlin.version>1.9.22</kotlin.version>
        <scala.version>2.13.12</scala.version>
        <kotlin.jvmTarget>21</kotlin.jvmTarget>
        <dokka.version>1.7.10</dokka.version>
        <jackson.version>2.15.2</jackson.version>
        <revision>4.0.0</revision>
        <changelist></changelist>
        <sha1/>
    </properties>

    <repositories>
<!--        <repository>-->
<!--            <id>maestro2-third-party</id>-->
<!--            <name>maestro2-third-party</name>-->
<!--            <url>https://overture.au.dk/artifactory/maestro2-third-party</url>-->
<!--        </repository>-->
<!--        <repository>-->
<!--            <id>overture.au.dk</id>-->
<!--            <name>overture.au.dk-releases</name>-->
<!--            <url>https://overture.au.dk/artifactory/into-cps</url>-->
<!--        </repository>-->
<!--        <repository>-->
<!--            <id>vdmj</id>-->
<!--            <name>overture.au.dk-vdmj</name>-->
<!--            <url>https://overture.au.dk/artifactory/vdmj</url>-->
<!--        </repository>-->
    </repositories>

    <modules>
        <module>core</module>
        <module>ast</module>
        <module>parser</module>
        <module>typechecker</module>
        <module>maestro</module>
        <module>interpreter</module>
        <module>plugins</module>
        <module>frameworks</module>
        <module>maestro-webapi</module>
        <module>codegen</module>
        <module>fmi</module>
        <module>modeldefinitionchecker</module>
    </modules>

    <build>
        <defaultGoal>package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.5</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.outbrain.swinfra</groupId>
                <artifactId>ci-friendly-flatten-maven-plugin</artifactId>
                <version>1.0.14</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.43</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectories>
                        <sourceDirectory>${project.build.sourceDirectory}
                        </sourceDirectory>
                        <sourceDirectory>${project.build.testSourceDirectory}
                        </sourceDirectory>
                    </sourceDirectories>
                    <checkstyleRules>
                        <module name="Checker">
                            <module name="TreeWalker">
                                <module name="NeedBraces"/>
                                <module name="PackageName">
                                    <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
                                </module>
                                <module name="MethodName">
                                    <property name="format" value="^[a-z](_?[a-zA-Z0-9]+)*$"/>
                                </module>
                            </module>
                        </module>
                    </checkstyleRules>
                </configuration>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <groupId>org.jetbrains.dokka</groupId>
                    <artifactId>dokka-maven-plugin</artifactId>
                    <version>${dokka.version}</version>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>javadocJar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <jdkVersion>${kotlin.jvmTarget}</jdkVersion>
                        <dokkaPlugins>
                            <plugin>
                                <groupId>org.jetbrains.dokka</groupId>
                                <artifactId>javadoc-plugin</artifactId>
                                <version>${dokka.version}</version>
                            </plugin>
                        </dokkaPlugins>
                    </configuration>
                </plugin>


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M1</version>
                    <configuration>
                        <releaseProfiles>release
                        </releaseProfiles>
                        <tagNameFormat>Release/@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>


                <!-- Attatch sources to all installed jars -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <attach>true</attach>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.11.2</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <failOnError>false</failOnError>
                        <quiet>true</quiet>
                        <doclint>all,-missing</doclint>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0-M2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.14.0</version>
                    <configuration>
                        <source>21</source>
                        <target>21</target>
                        <release>21</release>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.3</version>
                    <configuration>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <!-- Activate the use of TCP to transmit events to the plugin -->
                        <!-- https://stackoverflow.com/questions/55272870/surefire-maven-plugin-corrupted-stdout-by-directly-writing-to-native-stream-in -->
                        <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
                        <excludes>
                            <exclude>**/FullSpecCppTest.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <rulesets>
                            <ruleset>/rulesets/java/braces.xml</ruleset>
                            <ruleset>/rulesets/java/naming.xml</ruleset>
                        </rulesets>
                    </configuration>
                </plugin>
                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-assembly-plugin -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>


            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.4</version>
            </extension>
        </extensions>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.13.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.2.3</version>
            </plugin>
            <!--            <plugin>-->
            <!--                <groupId>org.jetbrains.dokka</groupId>-->
            <!--                <artifactId>dokka-maven-plugin</artifactId>-->
            <!--            </plugin>-->
        </plugins>
    </reporting>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.into-cps.verification</groupId>
                <artifactId>scenario_verifier</artifactId>
                <version>0.2.22</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.logging.log4j</groupId>
                        <artifactId>log4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-1.2-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

<!--            <dependency>-->
<!--                <groupId>guru.nidi</groupId>-->
<!--                <artifactId>graphviz-java</artifactId>-->
<!--                <exclusions>-->
<!--                    <exclusion>-->
<!--                        <groupId>org.slf4j</groupId>-->
<!--                        <artifactId>slf4j-log4j12</artifactId>-->
<!--                    </exclusion>-->
<!--                    <exclusion>-->
<!--                        <groupId>org.slf4j</groupId>-->
<!--                        <artifactId>slf4j-api</artifactId>-->
<!--                    </exclusion>-->
<!--                    <exclusion>-->
<!--                        <groupId>org.slf4j</groupId>-->
<!--                        <artifactId>slf4j-reload4j</artifactId>-->
<!--                    </exclusion>-->
<!--                    <exclusion>-->
<!--                        <groupId>log4j</groupId>-->
<!--                        <artifactId>log4j</artifactId>-->
<!--                    </exclusion>-->
<!--                </exclusions>-->
<!--            </dependency>-->

            <dependency>
                <groupId>org.into-cps.fmi</groupId>
                <artifactId>jnifmuapi</artifactId>
                <version>${fmu.api.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-reload4j</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.15.1</version>
                <scope>compile</scope>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.11</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>1.10.0</version>
            </dependency>

            <dependency>
                <groupId>org.into-cps.fmi</groupId>
                <artifactId>fmi2</artifactId>
                <version>${fmu.api.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.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>5.7.1</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <!-- Downgraded to 0.9.11 due to issues with zip file closing https://github.com/ronmamo/reflections/issues/279-->
                <version>0.9.11</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>3.9.0</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Either type -->
        <dependency>
            <groupId>com.spencerwi</groupId>
            <artifactId>Either.java</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.24.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.16</version>
        </dependency>
    </dependencies>

    <organization>
        <name>INTO CPS</name>
        <url>http://into-cps.org/</url>
    </organization>

    <scm>
        <url>git@github.com:INTO-CPS-Association/maestro</url>
        <connection>scm:git:git//github.com/INTO-CPS-Association/maestro
        </connection>
        <developerConnection>
            scm:git:git@github.com:INTO-CPS-Association/maestro
        </developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>thule</id>
            <email>casper.thule@eng.au.dk</email>
            <name>Casper Thule</name>
            <roles>
                <role>architect</role>
                <role>developer</role>
                <role>productowner</role>
            </roles>
            <organization>Aarhus University</organization>
            <organizationUrl>https://eng.au.dk</organizationUrl>
        </developer>
        <developer>
            <id>lausdahl</id>
            <email>lausdahl@eng.au.dk</email>
            <name>Kenneth Lausdahl</name>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <organization>Aarhus University</organization>
            <organizationUrl>http://eng.au.dk/</organizationUrl>
        </developer>

    </developers>

    <licenses>
        <license>
            <name>INTO-CPS Association Public License</name>
            <url>https://github.com/INTO-CPS-Association/INTO-CPS-Association.github.io/blob/master/LICENSE</url>
        </license>
    </licenses>

    <profiles>
        <profile>
            <id>external</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>external_tester</module>
            </modules>
        </profile>

        <profile>
            <id>include-fullSpecCppTest</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>

                        <configuration>
                            <excludes combine.self="override"/>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-enforcer-plugin</artifactId>
                            <version>3.0.0</version>
                            <executions>
                                <execution>
                                    <id>enforce-no-snapshots</id>
                                    <goals>
                                        <goal>enforce</goal>
                                    </goals>
                                    <configuration>
                                        <rules>
                                            <requireReleaseDeps>
                                                <message>No Snapshots Allowed!</message>
                                            </requireReleaseDeps>
                                        </rules>
                                        <fail>true</fail>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>sonatype</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>

            <build>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <!--                    <plugin>-->
                    <!--                        <groupId>org.jetbrains.dokka</groupId>-->
                    <!--                        <artifactId>dokka-maven-plugin</artifactId>-->
                    <!--                    </plugin>-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <!--autoReleaseAfterClose>true</autoReleaseAfterClose-->
                        </configuration>
                    </plugin>
                    <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>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>github</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>env.CI</name>
                </property>
            </activation>
        </profile>
    </profiles>
</project>
