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

    <groupId>org.getthedocs.documentengine</groupId>
    <artifactId>document-engine-parent</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Docx, xlsx template engine and pdf converter to provide document generation features.
        It is intended to generate single documents from WYSIWYG templates, based on placeholder logic in comments, or
        to create document sets/a single result document from template structures.
        The templates can be filled from JSON or Java objects as actual data via jsonpath and SpEL expression-like placeholders.

        The engine core is a java wrapper to other tools integrate their capabilities and can be used with typed DTO-s
        as a dependency also.</description>
    <url>http://www.getthedocs.tech</url>
    <scm>
        <connection>scm:git:git@github.com/get-the-docs/document-engine.git</connection>
        <developerConnection>scm:git:ssh@github.com:get-the-docs/document-engine.git</developerConnection>
        <url>https://github.com/get-the-docs/document-engine</url>
    </scm>
    <developers>
        <developer>
            <id>banlevente</id>
            <name>Levente Ban</name>
            <organization>GetTheDocs</organization>
            <organizationUrl>https://getthedocs.tech</organizationUrl>
            <email>levente.ban@getthedocs.org</email>
        </developer>
    </developers>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/get-the-docs/document-engine/issues</url>
    </issueManagement>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>17</java.version>
        <maven-enforcer-maven.version>3.3.9</maven-enforcer-maven.version>
        <lombok.version>1.18.22</lombok.version>
        <docx4j.version>11.5.3</docx4j.version>
        <jaxb-api.version>4.0.2</jaxb-api.version>
        <poi.version>5.4.0</poi.version>
        <mapstruct.version>1.4.2.Final</mapstruct.version>
        <jackson.version>2.15.0-rc1</jackson.version>
        <commons-lang3.version>3.8.1</commons-lang3.version>
        <json.version>20190722</json.version>
        <slf4j.version>2.0.6</slf4j.version>
        <junit.version>5.11.1</junit.version>
        <clover.version>4.5.2</clover.version>
        <sonar.organization>get-the-docs</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.projectKey>get-the-docs_document-engine</sonar.projectKey>
        <logback.version>1.5.13</logback.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

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

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.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-jsr310</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>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>docs-core-api</module>
        <module>docs-core</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.5.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>${java.version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <release>${java.version}</release>
                        <fork>true</fork>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=java.base/java.lang.reflect=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=java.base/java.io=ALL-UNNAMED</arg>
                            <arg>-J--add-opens=java.base/java.time=ALL-UNNAMED</arg>
                            <arg>-J--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
                            <arg>-J--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</arg>
                        </compilerArgs>
                        <encoding>UTF-8</encoding>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=java.base/java.io=ALL-UNNAMED</argLine>
                        <argLine>--add-opens=java.base/java.time=ALL-UNNAMED</argLine>
                        <argLine>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</argLine>
                        <argLine>--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.6.3</version>
                    <configuration>
                        <source>${java.version}</source>
                        <release>${java.version}</release>
                        <encoding>UTF-8</encoding>
                        <maxmemory>1g</maxmemory>
                        <detectOfflineLinks>false</detectOfflineLinks>
                        <failOnWarnings>false</failOnWarnings>
                        <sourcepath>${project.basedir}/src/main/java</sourcepath>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>4.0.0-M16</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${java.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <licenseName>apache_v2</licenseName>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <organizationName>Levente Ban</organizationName>
                            <inceptionYear>2025</inceptionYear>
                            <roots>
                                <root>src/main/java</root>
                                <root>src/test/java</root>
                            </roots>
                            <excludes>
                                <exclude>*.json</exclude>
                                <exclude>**/org/getthedocs/documentengine/core/processor/docxstamper/*.java</exclude>
                              </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.8.2</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>coverage</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openclover</groupId>
                        <artifactId>clover-maven-plugin</artifactId>
                        <version>${clover.version}</version>
                        <configuration>
                            <targetPercentage>0%</targetPercentage>
                            <!--snapshot>${user.home}/.clover/${groupId}-${artifactId}/clover.snapshot</snapshot-->
                            <snapshot>${user.home}/.clover/atlassian-plugins-clover.snapshot</snapshot>
                            <singleCloverDatabase>true</singleCloverDatabase>
                            <generatePdf>false</generatePdf>
                            <generateXml>true</generateXml>
                            <generateHtml>true</generateHtml>
                            <generateJson>false</generateJson>
                            <excludes>
                                <exclude>**/api/configuration/*.java</exclude>
                                <exclude>**/ServiceApplication.java</exclude>
                                <exclude>**/api/model/*.java</exclude>
                                <exclude>**/src/test/**/*.java</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>clover</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>setup</goal>
                                </goals>
                            </execution>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>aggregate</goal>
                                    <goal>clover</goal>
                                    <goal>log</goal>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.openclover</groupId>
                        <artifactId>clover-maven-plugin</artifactId>
                        <version>${clover.version}</version>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jacoco</groupId>
                            <artifactId>jacoco-maven-plugin</artifactId>
                            <version>0.8.12</version>
                            <configuration>
                                <formats>
                                    <format>XML</format>
                                </formats>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>prepare-agent</id>
                                    <goals>
                                        <goal>prepare-agent</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <id>report</id>
                                    <phase>verify</phase>
                                    <goals>
                                        <goal>report</goal>
                                    </goals>
                                </execution>

                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.6</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--batch</arg>
                                <arg>--no-tty</arg>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                            <keyname>${env.MAVEN_GPG_PRIVATE_KEY_ID}</keyname>
                            <passphraseEnvName>MAVEN_GPG_PASSPHRASE</passphraseEnvName>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>false</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <reporting>

        <outputDirectory>target/site</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.5.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report-only</report> <!-- avoid re-running tests -->
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.6.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>ci-management</report>
                            <report>dependencies</report>
                            <report>dependency-info</report>
                            <report>dependency-management</report>
                            <report>licenses</report>
                            <report>scm</report>
                            <report>issue-management</report>
                            <report>modules</report>
                            <report>distribution-management</report>
                            <report>plugin-management</report>
                            <report>plugins</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
</reporting>

</project>
