<!--
  ~ This Original Work is copyright of 51 Degrees Mobile Experts Limited.
  ~ Copyright 2022 51 Degrees Mobile Experts Limited, Davidson House,
  ~ Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
  ~
  ~ This Original Work is licensed under the European Union Public Licence
  ~  (EUPL) v.1.2 and is subject to its terms as set out below.
  ~
  ~  If a copy of the EUPL was not distributed with this file, You can obtain
  ~  one at https://opensource.org/licenses/EUPL-1.2.
  ~
  ~  The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
  ~  amended by the European Commission) shall be deemed incompatible for
  ~  the purposes of the Work and the provisions of the compatibility
  ~  clause in Article 5 of the EUPL shall not apply.
  ~
  ~   If using the Work as, or as part of, a network application, by
  ~   including the attribution notice(s) required under Article 5 of the EUPL
  ~   in the end user terms of the application under an appropriate heading,
  ~   such notice(s) shall fulfill the requirements of that article.
  -->

<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.51degrees</groupId>
    <artifactId>pipeline</artifactId>
    <version>4.4.21</version>
    <packaging>pom</packaging>

    <name>51Degrees :: Pipeline</name>
    <url>https://51degrees.com</url>
    <description>Java implementation of 51Degrees Pipeline API</description>

    <organization>
        <name>51Degrees</name>
        <url>51degrees.com</url>
    </organization>
    <developers>
        <developer>
            <name>51Degrees</name>
            <email>support@51degrees.com</email>
        </developer>
    </developers>

    <modules>
        <module>pipeline.common</module>
        <module>pipeline.core</module>
        <module>pipeline.engines</module>
        <module>pipeline.caching</module>
        <module>pipeline.cloudrequestengine</module>
        <module>pipeline.engines.fiftyone</module>
        <module>pipeline.javascriptbuilder</module>
        <module>pipeline.jsonbuilder</module>
        <module>pipeline.web.packages</module>
        <module>pipeline.aggregate</module>
        <module>pipeline.developer-examples</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <junit.version>4.13.2</junit.version>
        <junit.jupiter.version>5.8.2</junit.jupiter.version>
        <slf4j-api.version>1.7.36</slf4j-api.version>
        <logback-classic.version>1.2.12</logback-classic.version>
        <mockito-core.version>4.3.1</mockito-core.version>
        <org.json.version>20211205</org.json.version>
        <reflections8.version>0.11.7</reflections8.version>
        <commons-text.version>1.10.0</commons-text.version>

        <jakarta.xml.bind-api.version>3.0.1</jakarta.xml.bind-api.version>
        <jaxb-runtime.version>3.0.2</jaxb-runtime.version>
        <jaxb-impl.version>3.0.2</jaxb-impl.version>

        <mustache-compiler.version>0.8.18</mustache-compiler.version>
        <graal-js-scriptengine.version>22.0.0.2</graal-js-scriptengine.version>
        <graal-js.version>22.0.0.2</graal-js.version>

        <maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-jarsigner-plugin.version>3.0.0</maven-jarsigner-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-project-info-reports-plugin.version>2.6</maven-project-info-reports-plugin.version>
        <maven-site-plugin.version>3.7</maven-site-plugin.version>

        <ossrh.baseurl>https://oss.sonatype.org</ossrh.baseurl>
        <snapshot-repository.id>ossrh</snapshot-repository.id>
        <snapshot-repository.url>${ossrh.baseurl}/content/repositories/snapshots/</snapshot-repository.url>
        <publishrepository.id>ossrh</publishrepository.id>
        <publishrepository.url>${ossrh.baseurl}/service/local/staging/deploy/maven2/</publishrepository.url>
        <fetchrepository.id>central</fetchrepository.id>
        <fetchrepository.url>https://repo1.maven.org/maven2</fetchrepository.url>

        <skippackagesign>true</skippackagesign>

    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- compile dependencies -->

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>${org.json.version}</version>
            </dependency>

            <!-- test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>${jakarta.xml.bind-api.version}</version>
            </dependency>

            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>${jaxb-impl.version}</version>
                <scope>runtime</scope>
            </dependency>

            <!-- runtime dependencies -->

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-classic.version}</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <showWarnings>true</showWarnings>
                        <compilerArgs>
                            <arg>-Xlint:all,-try,-options</arg>
                            <arg>-Werror</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-install</id>
                        <configuration>
                            <skip>${deployOnly}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-test</id>
                        <configuration>
                            <skip>${deployOnly}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>${publishrepository.id}</serverId>
                    <nexusUrl>${ossrh.baseurl}</nexusUrl>
                    <altStagingDirectory>${user.home}/.m2</altStagingDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    
                    <systemPropertyVariables>
                        <!-- this tells all tests run via surefire to pick their logback config up from the root -->
                        <!-- fwiw does not affect those run via main() which need to find their config by other means -->
                        <!--suppress UnresolvedMavenProperty -->
                        <logback.configurationFile>${maven.multiModuleProjectDirectory}/logback.xml</logback.configurationFile>
                        <!-- this sets the scope of file search (inter alia in Utils.getFilePath) to the project directory-->
                        <!--suppress UnresolvedMavenProperty -->
                        <project.root>${maven.multiModuleProjectDirectory}</project.root>
                        <!-- for JavaScriptBuilderTests -->
                        <polyglot.engine.WarnInterpreterOnly>false</polyglot.engine.WarnInterpreterOnly>
                    </systemPropertyVariables>
                    <properties>
                        <property>
                            <!-- customised test runner output - frames start and stop of the test so
                            you can tell more easily where a log output may have come from -->
                            <name>listener</name>
                            <value>fiftyone.common.testhelpers.MavenRunListener</value>
                        </property>
                    </properties>
                </configuration>
            </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>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <doclint>none</doclint>
                    <quiet>true</quiet>
<!--                    <tags>
                        &lt;!&ndash; Parse DoxyGen tags cleanly. &ndash;&gt;
                        <tag>
                            <name>example</name>
                            <placement>t</placement>
                            <head>Example</head>
                        </tag>
                        <tag>
                            <name>include</name>
                            <placement>t</placement>
                        </tag>
                        <tag>
                            <name>include{doc}</name>
                            <placement>t</placement>
                        </tag>
                    </tags>-->
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jarsigner-plugin</artifactId>
                <version>${maven-jarsigner-plugin.version}</version>
                <executions>
                <execution>
                    <id>sign</id>
                    <goals>
                    <goal>sign</goal>
                    </goals>
                </execution>
                </executions>
                <configuration>
                    <skip>${skippackagesign}</skip>
                    <keystore>${keystore}</keystore>
                    <alias>${alias}</alias>
                    <storepass>${keystorepass}</storepass>
                    <keypass>${keypass}</keypass>
                </configuration>
            </plugin>
           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <configuration>
                    <skip>${skippackagesign}</skip>
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <distributionManagement>
        <repository>
            <id>${publishrepository.id}</id>
            <url>${publishrepository.url}</url>
        </repository>
        <snapshotRepository>
            <id>${snapshot-repository.id}</id>
            <url>${snapshot-repository.url}</url>
        </snapshotRepository>
        <site>
            <id>local</id>
            <url>file:///${maven.multiModuleProjectDirectory}/site/</url>
        </site>
    </distributionManagement>

    <repositories>
        <repository>
            <id>${fetchrepository.id}</id>
            <url>${fetchrepository.url}</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${snapshot-repository.id}</id>
            <url>${snapshot-repository.url}</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <licenses>
        <license>
            <name>European Union Public License 1.2</name>
            <url>https://opensource.org/licenses/EUPL-1.2</url>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/51Degrees/pipeline-java</url>
        <connection>scm:git:git://github.com/51Degrees/pipeline-java.git</connection>
        <developerConnection>scm:git:info@51degrees.com:51Degrees/pipeline-java.git</developerConnection>
    </scm>
</project>
