<?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" child.project.url.inherit.append.path="false">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.instancio</groupId>
    <artifactId>instancio-parent</artifactId>
    <version>6.0.0-RC2</version>
    <packaging>pom</packaging>

    <name>Instancio Parent</name>
    <description>Instancio is a library for auto-populating objects with random data.</description>
    <url>https://www.instancio.org</url>
    <organization>
        <name>Instancio</name>
        <url>https://www.instancio.org</url>
    </organization>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>armandino</id>
            <name>Arman Sharif</name>
            <email>instancio@pm.me</email>
            <url>https://github.com/armandino</url>
        </developer>
        <developer>
            <id>evaristegalois11</id>
            <name>Claudio Nave</name>
            <email>evaristegalois11@proton.me</email>
            <url>https://github.com/evaristegalois11</url>
        </developer>
    </developers>

    <scm child.scm.url.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.connection.inherit.append.path="false">
        <url>https://github.com/instancio/instancio</url>
        <connection>scm:git:https://github.com/instancio/instancio.git</connection>
        <developerConnection>scm:git:https://github.com/instancio/instancio.git</developerConnection>
        <tag>instancio-parent-6.0.0-RC2</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.enforcer.require.java.version>[17,)</maven.enforcer.require.java.version>
        <sonar.organization>instancio</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.coverage.jacoco.xmlReportPaths>
            ${maven.multiModuleProjectDirectory}/instancio-tests/report-aggregate/target/site/jacoco-aggregate/jacoco.xml,
            ${maven.multiModuleProjectDirectory}/instancio-tests/kotlin-tests/instancio-kotlin-api-tests/target/kover/report.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <latest.release.version>6.0.0-RC2</latest.release.version>
        <version.guava>33.5.0-jre</version.guava>
        <version.hibernate.validator>9.1.0.Final</version.hibernate.validator>
        <version.highlight.js>11.11.1</version.highlight.js>
        <version.jackson>3.1.0</version.jackson>
        <version.groovy>5.0.4</version.groovy>
        <version.jakarta.persistence>3.2.0</version.jakarta.persistence>
        <version.jakarta.validation>3.1.1</version.jakarta.validation>
        <version.jspecify>1.0.0</version.jspecify>
        <version.junit>6.0.3</version.junit>
        <version.kotlin>2.3.10</version.kotlin>
        <version.slf4j>2.0.17</version.slf4j>
        <version.errorprone>2.48.0</version.errorprone>
        <version.nullaway>0.13.1</version.nullaway>
        <!-- plugins -->
        <version.central-publishing-maven-plugin>0.10.0</version.central-publishing-maven-plugin>
        <version.jacoco-maven-plugin>0.8.14</version.jacoco-maven-plugin>
        <version.maven-bundle-plugin>6.0.2</version.maven-bundle-plugin>
        <version.maven-checkstyle-plugin>3.6.0</version.maven-checkstyle-plugin>
        <version.maven-compiler-plugin>3.15.0</version.maven-compiler-plugin>
        <version.maven-enforcer-plugin>3.6.2</version.maven-enforcer-plugin>
        <version.maven-gpg-plugin>3.2.8</version.maven-gpg-plugin>
        <version.maven-jar-plugin>3.5.0</version.maven-jar-plugin>
        <version.maven-javadoc-plugin>3.12.0</version.maven-javadoc-plugin>
        <version.maven-pmd-plugin>3.28.0</version.maven-pmd-plugin>
        <version.maven-release-plugin>3.3.1</version.maven-release-plugin>
        <version.maven-site-plugin>3.21.0</version.maven-site-plugin>
        <version.maven-source-plugin>3.4.0</version.maven-source-plugin>
        <version.kover-maven-plugin>0.9.7</version.kover-maven-plugin>
        <version.sonar-maven-plugin>5.5.0.6356</version.sonar-maven-plugin>
        <version.spotbugs-maven-plugin>4.9.8.2</version.spotbugs-maven-plugin>
        <version.versions-maven-plugin>2.21.0</version.versions-maven-plugin>
        <version.flatten-maven-plugin>1.7.3</version.flatten-maven-plugin>
        <version.maven-clean-plugin>3.5.0</version.maven-clean-plugin>
        <version.maven-resources-plugin>3.5.0</version.maven-resources-plugin>
        <version.maven-install-plugin>3.1.4</version.maven-install-plugin>
        <version.maven-deploy-plugin>3.1.4</version.maven-deploy-plugin>
        <version.maven-failsafe-plugin>3.5.5</version.maven-failsafe-plugin>
        <version.maven-surefire-plugin>3.5.5</version.maven-surefire-plugin>
    </properties>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/instancio/instancio/issues</url>
    </issueManagement>

    <modules>
        <module>build-tools</module>
        <module>instancio-core</module>
        <module>instancio-junit</module>
        <module>instancio-kotlin</module>
        <module>instancio-guava</module>
        <module>instancio-bom</module>
        <module>instancio-tests</module>
    </modules>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>error-prone</id>
            <activation>
                <file>
                    <exists>${basedir}/.run-error-prone</exists>
                </file>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <compilerArgs>
                                    <arg>-XDcompilePolicy=simple</arg>
                                    <!-- Needed by ErrorProne when using Java 21 -->
                                    <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
                                    <arg>--should-stop=ifError=FLOW</arg>
                                    <arg>
                                        -Xplugin:ErrorProne
                                        -Xep:NullAway:ERROR
                                        -XepExcludedPaths:.*/target/generated-sources/.*
                                        -XepOpt:NullAway:AnnotatedPackages=org.instancio
                                        -XepOpt:NullAway:CustomContractAnnotations=org.instancio.documentation.Contract
                                        -XepOpt:NullAway:CustomInitializerAnnotations=org.instancio.documentation.Initializer
                                        -XepOpt:NullAway:ExcludedClassAnnotations=lombok.Data,lombok.Builder
                                        -XepOpt:NullAway:ExcludedFieldAnnotations=org.instancio.junit.Given,org.instancio.junit.WithSettings
                                        -XepOpt:NullAway:JSpecifyMode=true
                                        -XepOpt:NullAway:TreatGeneratedAsUnannotated=true
                                        -Xep:AnnotateFormatMethod:OFF
                                        -Xep:BooleanLiteral:OFF
                                        -Xep:CharacterGetNumericValue:OFF
                                        -Xep:DefaultCharset:OFF
                                        -Xep:DoNotCallSuggester:OFF
                                        -Xep:EffectivelyPrivate:OFF
                                        -Xep:ImmutableEnumChecker:OFF
                                        -Xep:JavaInstantGetSecondsGetNano:OFF
                                        -Xep:JavaTimeDefaultTimeZone:OFF
                                        -Xep:MissingSummary:OFF
                                        -Xep:MixedMutabilityReturnType:OFF
                                        -Xep:NullArgumentForNonNullParameter:OFF
                                        -Xep:StaticAssignmentOfThrowable:OFF
                                        -Xep:StringSplitter:OFF
                                        -Xep:UnusedMethod:OFF
                                        -Xep:UnusedVariable:OFF
                                    </arg>
                                </compilerArgs>
                                <annotationProcessorPaths>
                                    <path>
                                        <groupId>com.google.errorprone</groupId>
                                        <artifactId>error_prone_core</artifactId>
                                        <version>${version.errorprone}</version>
                                    </path>
                                    <path>
                                        <groupId>com.uber.nullaway</groupId>
                                        <artifactId>nullaway</artifactId>
                                        <version>${version.nullaway}</version>
                                    </path>
                                </annotationProcessorPaths>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <!-- Error Prone requires Java 21+; disable it on older JDKs even when .run-error-prone is present -->
            <id>error-prone-skip-java-lt-21</id>
            <activation>
                <jdk>(,21)</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <compilerArgs combine.self="override" />
                                <annotationProcessorPaths combine.self="override" />
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${version.maven-enforcer-plugin}</version>
                    <executions>
                        <execution>
                            <id>default-cli</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <dependencyConvergence />
                                    <requireJavaVersion>
                                        <version>${maven.enforcer.require.java.version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${version.maven-compiler-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${version.maven-clean-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${version.maven-resources-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${version.maven-install-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${version.maven-deploy-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.maven-surefire-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${version.maven-failsafe-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${version.maven-source-plugin}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${version.versions-maven-plugin}</version>
                    <configuration>
                        <property>latest.release.version</property>
                        <newVersion>${project.version}</newVersion>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${version.flatten-maven-plugin}</version>
                    <executions>
                        <execution>
                            <id>flatten</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>flatten</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>flatten-clean</id>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <flattenMode>ossrh</flattenMode>
                        <pomElements>
                            <build>remove</build>
                            <repositories>remove</repositories>
                        </pomElements>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${version.jacoco-maven-plugin}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlinx</groupId>
                    <artifactId>kover-maven-plugin</artifactId>
                    <version>${version.kover-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${version.maven-pmd-plugin}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.instancio</groupId>
                            <artifactId>build-tools</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                                <goal>cpd-check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <printFailingErrors>true</printFailingErrors>
                        <failOnViolation>true</failOnViolation>
                        <failurePriority>4</failurePriority>
                        <minimumTokens>120</minimumTokens>
                        <rulesets>
                            <ruleset>pmd-rules.xml</ruleset>
                        </rulesets>
                        <excludeRoots>
                            <excludeRoot>target/generated-sources/</excludeRoot>
                        </excludeRoots>
                        <linkXRef>false</linkXRef>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.maven-checkstyle-plugin}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>13.3.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.instancio</groupId>
                            <artifactId>build-tools</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <configLocation>checkstyle.xml</configLocation>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${version.sonar-maven-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.maven-javadoc-plugin}</version>
                    <configuration>
                        <release>17</release>
                        <show>public</show>
                        <encoding>UTF-8</encoding>
                        <docencoding>UTF-8</docencoding>
                        <charset>UTF-8</charset>
                        <additionalOptions>-html5 --allow-script-in-comments</additionalOptions>
                        <nohelp>true</nohelp>
                        <javadocDirectory>${maven.multiModuleProjectDirectory}/build-tools/src/main/javadoc</javadocDirectory>
                        <addStylesheets>
                            <stylesheet>instancio-theme.css</stylesheet>
                            <stylesheet>hljs-theme.css</stylesheet>
                        </addStylesheets>
                        <bottom><![CDATA[
                        Copyright &#169; {currentYear} <a href="https://www.instancio.org">Instancio</a>. All rights reserved.
                        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/${version.highlight.js}/highlight.min.js"></script>
                        <script>hljs.configure({languages:['java']});hljs.highlightAll();</script>
                        ]]></bottom>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${version.maven-jar-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${version.maven-bundle-plugin}</version>
                    <executions>
                        <execution>
                            <id>bundle-manifest</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.maven-gpg-plugin}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <keyname>${gpg.keyname}</keyname>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${version.central-publishing-maven-plugin}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${version.maven-release-plugin}</version>
                    <configuration>
                        <preparationGoals>clean versions:set-property verify</preparationGoals>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <localCheckout>true</localCheckout>
                        <scmCommentPrefix>[skip ci][maven-release-plugin]</scmCommentPrefix>
                        <preparationProfiles>release</preparationProfiles>
                        <releaseProfiles>release,sign</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${version.spotbugs-maven-plugin}</version>
                    <configuration>
                        <failOnError>true</failOnError>
                        <threshold>Low</threshold>
                        <effort>max</effort>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${version.maven-site-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jspecify</groupId>
                <artifactId>jspecify</artifactId>
                <version>${version.jspecify}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.persistence</groupId>
                <artifactId>jakarta.persistence-api</artifactId>
                <version>${version.jakarta.persistence}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${version.jakarta.validation}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${version.hibernate.validator}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>tools.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.jackson}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${version.groovy}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.junit}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${version.kotlin}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>central-portal-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>