<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>4.1.0</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>kz.innlab</groupId>
	<artifactId>auth-spring-boot-starter</artifactId>
	<version>0.0.7</version>
	<name>auth-spring-boot-starter</name>
	<description>Spring Boot Starter for JWT authentication with Google, Apple, local, and phone OTP login</description>
	<url>https://github.com/bekzatsk/spring-boot-template</url>
	<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>
	<developers>
		<developer>
			<id>bekzatsa</id>
			<name>Bekzat Saylaubay</name>
			<email>bekzat.saylaubay@gmail.com</email>
			<organization>innlab</organization>
			<organizationUrl>https://innlab.kz</organizationUrl>
		</developer>
	</developers>
	<scm>
		<connection>scm:git:git://github.com/bekzatsk/spring-boot-template.git</connection>
		<developerConnection>scm:git:ssh://github.com:bekzatsk/spring-boot-template.git</developerConnection>
		<url>https://github.com/bekzatsk/spring-boot-template/tree/master</url>
		<tag>HEAD</tag>
	</scm>
	<properties>
		<java.version>24</java.version>
		<kotlin.version>2.2.21</kotlin.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<!-- Align Google library versions between firebase-admin and google-api-client -->
			<dependency>
				<groupId>com.google.cloud</groupId>
				<artifactId>libraries-bom</artifactId>
				<version>26.55.0</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-webmvc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-oauth2-authorization-server</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
		</dependency>
		<!-- Actuator: bundled so consumers get /actuator/health out of the box -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-reflect</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-stdlib</artifactId>
		</dependency>
		<dependency>
			<groupId>tools.jackson.module</groupId>
			<artifactId>jackson-module-kotlin</artifactId>
		</dependency>

		<!-- Flyway — required in Boot 4.0 (not bare flyway-core) -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-flyway</artifactId>
		</dependency>
		<!-- Flyway 10+ modular PostgreSQL driver support — required for PostgreSQL 18.x -->
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-database-postgresql</artifactId>
		</dependency>

		<!-- UUID v7 (time-ordered) generation — RFC 9562 compliant -->
		<dependency>
			<groupId>com.github.f4b6a3</groupId>
			<artifactId>uuid-creator</artifactId>
			<version>6.1.1</version>
		</dependency>

		<!-- Phone number parsing and E.164 normalization -->
		<dependency>
			<groupId>com.googlecode.libphonenumber</groupId>
			<artifactId>libphonenumber</artifactId>
			<version>8.13.52</version>
		</dependency>

		<!-- Twilio SDK for WhatsApp + SMS OTP delivery (optional: only loaded when consumer enables) -->
		<dependency>
			<groupId>com.twilio.sdk</groupId>
			<artifactId>twilio</artifactId>
			<version>11.3.3</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-webmvc-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-test-junit5</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.google.api-client</groupId>
			<artifactId>google-api-client</artifactId>
			<version>2.9.0</version>
		</dependency>

		<!-- Firebase Admin SDK for push notifications -->
		<dependency>
			<groupId>com.google.firebase</groupId>
			<artifactId>firebase-admin</artifactId>
			<version>9.4.3</version>
		</dependency>

		<!-- Email sending via SMTP -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-mail</artifactId>
		</dependency>

		<!-- OpenAPI / Swagger UI -->
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
			<version>3.0.2</version>
		</dependency>
		<!-- Jackson 2 stop-gap: required because swagger-core still depends on Jackson 2,
		     while Spring Boot 4 defaults to Jackson 3. Remove when springdoc upgrades swagger-core. -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-jackson2</artifactId>
		</dependency>

		<!-- In-process SMTP/IMAP server for integration tests -->
		<dependency>
			<groupId>com.icegreen</groupId>
			<artifactId>greenmail-spring</artifactId>
			<version>2.1.3</version>
			<scope>test</scope>
		</dependency>

		<!-- Asynchronous assertion library for integration tests -->
		<dependency>
			<groupId>org.awaitility</groupId>
			<artifactId>awaitility-kotlin</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
		<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
		<plugins>
			<plugin>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-maven-plugin</artifactId>
				<configuration>
					<args>
						<arg>-Xjsr305=strict</arg>
						<arg>-Xannotation-default-target=param-property</arg>
					</args>
					<compilerPlugins>
						<plugin>spring</plugin>
						<plugin>jpa</plugin>
						<plugin>all-open</plugin>
					</compilerPlugins>
					<pluginOptions>
						<option>all-open:annotation=jakarta.persistence.Entity</option>
						<option>all-open:annotation=jakarta.persistence.MappedSuperclass</option>
						<option>all-open:annotation=jakarta.persistence.Embeddable</option>
					</pluginOptions>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.jetbrains.kotlin</groupId>
						<artifactId>kotlin-maven-allopen</artifactId>
						<version>${kotlin.version}</version>
					</dependency>
					<dependency>
						<groupId>org.jetbrains.kotlin</groupId>
						<artifactId>kotlin-maven-noarg</artifactId>
						<version>${kotlin.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<!-- Sources jar -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.3.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- Empty javadoc jar (Maven Central requires *-javadoc.jar; Kotlin uses KDoc, not Javadoc) -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<version>3.4.1</version>
						<executions>
							<execution>
								<id>empty-javadoc-jar</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>javadoc</classifier>
									<classesDirectory>${project.basedir}/.empty-javadoc</classesDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- GPG signing -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.2.7</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- Central Portal publishing -->
					<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>
							<waitUntil>validated</waitUntil>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
