<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ SPDX-FileCopyrightText: 2017-2026 Enedis
  ~
  ~ SPDX-License-Identifier: Apache-2.0
  ~
  -->

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

  <groupId>fr.enedis.chutney</groupId>
  <artifactId>chutney-testing-parent</artifactId>
  <version>4.3.0</version>
  <packaging>pom</packaging>

  <name>chutney-testing</name>
  <url>https://github.com/Enedis-OSS/chutney</url>
  <description>An opinionated test application to help you practice Specification by Example.</description>
  <inceptionYear>2017</inceptionYear>

  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Loïc Ledoyen</name>
      <url>https://github.com/ledoyen</url>
    </developer>
    <developer>
      <name>Mael Besson</name>
      <url>https://github.com/bessonm</url>
    </developer>
    <developer>
      <name>Matthieu Gensollen</name>
      <url>https://github.com/boddissattva</url>
    </developer>
    <developer>
      <name>Nicolas Brouand</name>
      <url>https://github.com/nbrouand</url>
    </developer>
    <developer>
      <name>Karim Goubbaa</name>
      <url>https://github.com/KarimGl</url>
    </developer>
    <developer>
      <name>Alexandre Delaunay</name>
      <url>https://github.com/DelaunayAlex</url>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/Enedis-OSS/chutney.git</url>
    <connection>scm:git:git@github.com:Enedis-OSS/chutney.git</connection>
    <developerConnection>scm:git:git@github.com:Enedis-OSS/chutney.git</developerConnection>
    <tag>4.3.0</tag>
  </scm>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/Enedis-OSS/chutney/issues</url>
  </issueManagement>

  <ciManagement>
    <system>github-actions-ci</system>
    <url>https://github.com/Enedis-OSS/chutney/actions</url>
  </ciManagement>

  <modules>
    <module>chutney</module>
    <module>kotlin-dsl</module>
    <module>acceptance-tests</module>
    <module>example</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>

    <buildMetadataRequired>false</buildMetadataRequired>
    <chutney.version>${project.version}</chutney.version>

    <testcontainers.version>2.0.5</testcontainers.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>fr.enedis.chutney</groupId>
        <artifactId>chutney-kotlin-dsl</artifactId>
        <version>${chutney.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>de.smartics.maven.plugin</groupId>
        <artifactId>buildmetadata-maven-plugin</artifactId>
        <configuration>
          <queryRangeInDays>100</queryRangeInDays>
          <failOnMissingRevision>${buildMetadataRequired}</failOnMissingRevision>
        </configuration>
        <executions>
          <execution>
            <phase>initialize</phase>
            <goals>
              <goal>provide-buildmetadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.5</version>
          <executions>
            <execution>
              <id>default-test</id>
              <phase>test</phase>
              <goals>
                <goal>test</goal>
              </goals>
              <configuration>
                <systemPropertyVariables>
                  <http.proxyHost>${http.proxyHost}</http.proxyHost>
                  <http.proxyPort>${http.proxyPort}</http.proxyPort>
                  <http.nonProxyHosts>${http.nonProxyHosts}</http.nonProxyHosts>
                  <https.proxyHost>${https.proxyHost}</https.proxyHost>
                  <https.proxyPort>${https.proxyPort}</https.proxyPort>
                  <https.nonProxyHosts>${https.nonProxyHosts}</https.nonProxyHosts>
                </systemPropertyVariables>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.5.5</version>
          <executions>
            <execution>
              <id>integration-test</id>
              <phase>integration-test</phase>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.4</version>
        </plugin>
        <plugin>
          <groupId>de.smartics.maven.plugin</groupId>
          <artifactId>buildmetadata-maven-plugin</artifactId>
          <version>1.7.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.4.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.12.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-SCM-Revision-Number>${build.scmRevision.id}
                </Implementation-SCM-Revision-Number>
                <Implementation-SCM-Revision-Date>${build.scmRevision.date}
                </Implementation-SCM-Revision-Date>
                <Implementation-Date>${build.date}</Implementation-Date>
                <Implementation-Timestamp>${build.timestamp.millis}</Implementation-Timestamp>
                <Implementation-DatePattern>${build.date.pattern}</Implementation-DatePattern>
                <Implementation-Full-Version>${build.version.full}</Implementation-Full-Version>
                <Built-Host>${build.host.name}</Built-Host>
                <Built-OS>${os.name} / ${os.arch} / ${os.version}</Built-OS>
                <Built-By>${build.user}</Built-By>
                <Maven-Version>${build.maven.version}</Maven-Version>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <!--This plugin's configuration is used to store Eclipse
                          m2e settings only. It has no influence on the Maven build itself. -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>de.smartics.maven.plugin</groupId>
                    <artifactId>buildmetadata-maven-plugin</artifactId>
                    <versionRange>[1.6.1,)</versionRange>
                    <goals>
                      <goal>provide-buildmetadata</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute/>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.14</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.6.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.6.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>


  <profiles>
    <profile>
      <id>convergence</id>
      <activation>
        <property>
          <name>convergence</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce</id>
                <configuration>
                  <rules>
                    <dependencyConvergence/>
                  </rules>
                  <fail>true</fail>
                </configuration>
                <goals>
                  <goal>enforce</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>github</id>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/Enedis-OSS/chutney</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <id>central</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <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-javadoc-plugin</artifactId>
            <configuration>
              <doclint>none</doclint>
              <quiet>true</quiet>
              <sourcepath>
                ${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations;
                ${project.build.sourceDirectory}:${project.build.directory}/generated-sources/jaxb
              </sourcepath>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <configuration>
              <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>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.10.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <excludeArtifacts>
                <excludeArtifact>local-api-unsecure</excludeArtifact>
                <excludeArtifact>acceptance-tests</excludeArtifact>
                <excludeArtifact>local-dev</excludeArtifact>
                <excludeArtifact>example</excludeArtifact>
                <excludeArtifact>packaging</excludeArtifact>
              </excludeArtifacts>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
