<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  ~ the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  ~ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations under the License.
  ~
  ~ Copyright 2013-2016 the original author or authors.
  -->

<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">
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ COORDONATES ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.ff4j</groupId>
  <artifactId>ff4j-spring-boot-starter-parent</artifactId>
  <version>2.1</version>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ MAIN INFO ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <name>ff4j-spring-boot-starter-parent</name>
  <packaging>pom</packaging>
  <url>https://ff4j.github.io/</url>
  <inceptionYear>2013</inceptionYear>
  <description>
    FF4J, stands for Feature Flipping for Java, helps you to implement the 'feature toggle' agile
    development
    practice.
    Features (services/behaviour/treatments/screen parts) can be enabled and disabled at runtime but
    also limited to
    an authorized
    sub-set of users (e.g : beta-testers for beta feature). Once the feature is enabled and granted
    you can
    implement your own strategy
    to flip through custom FlippingStrategy.
  </description>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ GIT (GITHUB) ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <scm>
    <connection>scm:git:git@github.com:ff4j/ff4j-spring-boot-starter-parent.git</connection>
    <developerConnection>scm:git:git@github.com:ff4j/ff4j-spring-boot-starter-parent.git
    </developerConnection>
    <url>git@github.com:ff4j/ff4j-spring-boot-starter-parent.git</url>
    <tag>2.1</tag>
  </scm>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ LICENSE (APACHE2) ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ ORGANIZATION ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <organization>
    <name>FF4J</name>
    <url>http://ff4j.org</url>
  </organization>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ PROPERTIES               ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>21</java.version>
    <spring-boot.version>3.2.4</spring-boot.version>
    <ff4j.version>2.1</ff4j.version>
    <jackson-module-kotlin.version>2.17.0</jackson-module-kotlin.version>
    <kotlin.version>1.9.23</kotlin.version>
    <cucumber.version>7.16.1</cucumber.version>
    <springdoc-openapi-starter.version>2.5.0</springdoc-openapi-starter.version>
    <meanbean.version>2.0.3</meanbean.version>
    <!-- plugin -->
    <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
    <license-maven-plugin.version>2.4.0</license-maven-plugin.version>
    <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
    <maven-gpg-plugin.version>3.2.3</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
    <aven-source-plugin.version>3.3.1</aven-source-plugin.version>
    <dokka-maven-plugin.version>1.9.20</dokka-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
    <maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
    <dokka.plugin.version>0.10.0</dokka.plugin.version>
    <kotlin.code.style>official</kotlin.code.style>
    <license.path>${project.baseUri}/src/license</license.path>
  </properties>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ CHILD MODULES            ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <modules>
    <module>ff4j-spring-services</module>
    <module>ff4j-spring-rest-api</module>
    <module>ff4j-spring-boot-autoconfigure-common</module>
    <module>ff4j-spring-boot-autoconfigure-webmvc</module>
    <module>ff4j-spring-boot-starter-webmvc</module>
    <module>ff4j-spring-boot-autoconfigure-webflux</module>
    <module>ff4j-spring-boot-starter-webflux</module>
  </modules>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ DEPENDENCIES             ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <dependencyManagement>
    <dependencies>
      <!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-bom -->
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-bom</artifactId>
        <version>${kotlin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- spring -->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- FF4J -->
      <dependency>
        <groupId>org.ff4j</groupId>
        <artifactId>ff4j-core</artifactId>
        <version>${ff4j.version}</version>
      </dependency>
      <dependency>
        <artifactId>ff4j-aop</artifactId>
        <groupId>org.ff4j</groupId>
        <version>${ff4j.version}</version>
      </dependency>
      <dependency>
        <artifactId>ff4j-web</artifactId>
        <groupId>org.ff4j</groupId>
        <version>${ff4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.ff4j</groupId>
        <artifactId>ff4j-security-spring</artifactId>
        <version>${ff4j.version}</version>
      </dependency>
      <!-- Open API -->
      <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-common</artifactId>
        <version>${springdoc-openapi-starter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
        <version>${springdoc-openapi-starter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-webflux-api</artifactId>
        <version>${springdoc-openapi-starter.version}</version>
      </dependency>
      <!-- kotlin -->
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-kotlin</artifactId>
        <version>${jackson-module-kotlin.version}</version>
      </dependency>
      <!-- Test dependency -->
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>${easymock.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.meanbean</groupId>
        <artifactId>meanbean</artifactId>
        <version>${meanbean.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- Cucumber -->
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-bom</artifactId>
        <version>${cucumber.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <!-- JUnit 5 dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-suite</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- Kotlin -->
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-kotlin</artifactId>
    </dependency>
  </dependencies>
  <build>
    <finalName>ff4j-spring-boot-starter-parent</finalName>
    <directory>target</directory>
    <outputDirectory>target/classes</outputDirectory>
    <testOutputDirectory>target/test-classes</testOutputDirectory>
    <sourceDirectory>src/main/kotlin</sourceDirectory>
    <testSourceDirectory>src/test/kotlin</testSourceDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <testFailureIgnore>false</testFailureIgnore>
        </configuration>
      </plugin>
      <!-- maven enforcer -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <configuration>
          <rules>
            <dependencyConvergence />
            <requireReleaseDeps>
              <failWhenParentIsSnapshot>false</failWhenParentIsSnapshot>
              <excludes>
                <exclude>${project.groupId}:*</exclude>
              </excludes>
            </requireReleaseDeps>
          </rules>
          <fail>true</fail>
        </configuration>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>validate</phase>
          </execution>
        </executions>
      </plugin>
      <!-- kotlin -->
      <plugin>
        <artifactId>kotlin-maven-plugin</artifactId>
        <groupId>org.jetbrains.kotlin</groupId>
        <version>${kotlin.version}</version>
        <configuration>
          <compilerPlugins>
            <plugin>spring</plugin>
          </compilerPlugins>
          <jvmTarget>${java.version}</jvmTarget>
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <phase>process-sources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <sourceDirs>
                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
              </sourceDirs>
            </configuration>
          </execution>
          <execution>
            <id>test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>test-compile</goal>
            </goals>
            <configuration>
              <sourceDirs>
                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
              </sourceDirs>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-allopen</artifactId>
            <version>${kotlin.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</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>
      <!-- Coveralls.io -->
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>4.3.0</version>
      </plugin>
      <!-- Compiler -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <!-- license -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <verbose>false</verbose>
          <licenseName>apache_v2</licenseName>
          <licenseResolver>${license.path}</licenseResolver>
          <extraExtensions>
            <myProprietaryExtension>kt</myProprietaryExtension>
            <myProprietaryExtension>java</myProprietaryExtension>
          </extraExtensions>
        </configuration>
        <executions>
          <execution>
            <id>add-license</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <licenseName>apache_v2</licenseName>
              <roots>
                <root>src/main/kotlin</root>
                <root>src/test/kotlin</root>
              </roots>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Force UTF-8 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <configuration>
          <escapeString>\</escapeString>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <!-- Deploy to nexus -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${nexus-staging-maven-plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      <!-- TODO : to be fixed
      <plugin>
        <groupId>org.jetbrains.dokka</groupId>
        <artifactId>dokka-maven-plugin</artifactId>
        <version>${dokka.plugin.version}</version>
        <executions>
                     <execution>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
        </executions>
        <configuration>
          <includes>
            <file>packages.md</file>
          </includes>
        </configuration>
      </plugin>-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${aven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!-- release through SCM -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
            <goals>deploy</goals>
          </configuration>
        </plugin>

        <!-- Allow import in eclipse -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <versionRange>[1.13.50,)</versionRange>
                    <goals>
                      <goal>test-compile</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <!-- Global Properties -->
      <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${aven-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>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Maven need dokka to produce the javadoc files -->
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
            <version>${dokka-maven-plugin.version}</version>
            <executions>
              <execution>
                <phase>prepare-package</phase>
                <goals>
                  <goal>dokka</goal>
                  <goal>javadoc</goal>
                  <goal>javadocJar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>1_maven.apache.org</id>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
    </repository>
    <repository>
      <id>2_spring.repo</id>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <url>http://repo.spring.io/plugins-release/</url>
      <layout>default</layout>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>1_maven.apache.org</id>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
    </pluginRepository>
    <pluginRepository>
      <id>2_spring.repo</id>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <url>https://repo.spring.io/plugins-release/</url>
      <layout>default</layout>
    </pluginRepository>
  </pluginRepositories>
  <developers>
    <developer>
      <id>paul58914080</id>
      <name>Paul WILLIAMS</name>
      <email>paul58914080@gmail.com</email>
      <url>https://github.com/paul58914080</url>
      <organization>ff4j</organization>
      <organizationUrl>https://ff4j.github.io</organizationUrl>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>GMT+5:30</timezone>
      <properties>
        <picUrl />
      </properties>
    </developer>
  </developers>
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <!-- ~ Issue Management ~ -->
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
  <issueManagement>
    <system>IssueTracking@Github</system>
    <url>
      <![CDATA[https://github.com/ff4j/ff4j-spring-boot-starter-parent/issues?sort=created&direction=desc&state=open]]></url>
  </issueManagement>

  <!-- Mandatory for releasing to central -->
  <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>
</project>
