<?xml version="1.0" encoding="UTF-8"?>
<!--

    The MIT License
    Copyright © 2023 Landeshauptstadt München | it@M

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

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

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.3.4</version><!-- keep prop spring-boot.version in sync! -->
	</parent>

	<groupId>de.muenchen.oss.ezldap</groupId>
	<artifactId>ezLDAP-parent</artifactId>
	<version>1.0.3</version>
	<name>${project.groupId}:${project.artifactId}</name>
	<description>custom tailored REST API for read access to LDAP</description>
	<url>https://github.com/it-at-m/ezLDAP</url>
	<packaging>pom</packaging>

	<modules>
		<module>microservice</module>
		<module>client-v1</module>
		<module>lib-core</module>
		<module>lib-spring</module>
	</modules>

	<properties>
		<!-- current/latest API version -->
		<api.version>v1</api.version>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>17</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<spring-boot.version>3.3.4</spring-boot.version>
		<org.mapstruct.version>1.6.2</org.mapstruct.version>
		<org.projectlombok.version>1.18.34</org.projectlombok.version>
		<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>

		<logstash.encoder>8.0</logstash.encoder>
	</properties>

	<scm>
		<url>https://github.com/it-at-m/ezLDAP</url>
		<connection>scm:git:https://github.com/it-at-m/ezLDAP.git</connection>
		<developerConnection>
			scm:git:https://github.com/it-at-m/ezLDAP.git</developerConnection>
		<tag>v1.0.3</tag>
	</scm>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.projectlombok</groupId>
				<artifactId>lombok</artifactId>
				<version>${org.projectlombok.version}</version>
			</dependency>
			<dependency>
				<groupId>org.mapstruct</groupId>
				<artifactId>mapstruct</artifactId>
				<version>${org.mapstruct.version}</version>
			</dependency>

			<!-- internal dependencies -->
			<dependency>
				<groupId>de.muenchen.oss.ezldap</groupId>
				<artifactId>ezLDAP-client-v1</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.muenchen.oss.ezldap</groupId>
				<artifactId>ezLDAP-lib-core</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.muenchen.oss.ezldap</groupId>
				<artifactId>ezLDAP-microservice</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.muenchen.oss.ezldap</groupId>
				<artifactId>ezLDAP-lib-spring</artifactId>
				<version>${project.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>


	<build>
		<plugins>
			<plugin>
				<artifactId>maven-scm-plugin</artifactId>
				<version>2.1.0</version>
				<configuration>
					<tag>${project.version}</tag>
				</configuration>
			</plugin>
			<!-- to use mvn versions:set on beginning of new spring -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
			</plugin>
			<!-- license plugin -->
			<plugin>
				<groupId>com.mycila</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>4.6</version>
				<configuration>
					<properties>
						<owner>Landeshauptstadt München | it@M</owner>
						<year>2023</year>
					</properties>
					<licenseSets>
						<licenseSet>
							<header>
								com/mycila/maven/plugin/license/templates/MIT.txt</header>
							<includes>
								<include>**/*.java</include>
								<include>**/*.xml</include>
								<include>**/*.yml</include>
								<include>**/*.properties</include>
							</includes>
							<excludes>
								<exclude>**/LICENSE</exclude>
								<exclude>**/README</exclude>
								<exclude>**/src/test/resources/**</exclude>
								<exclude>**/src/main/resources/**</exclude>
							</excludes>
						</licenseSet>
					</licenseSets>
					<mapping>
						<java>SLASHSTAR_STYLE</java>
					</mapping>
				</configuration>
				<executions>
					<execution>
						<id>check-license-headers</id>
						<goals>
							<goal>check</goal>
						</goals>
						<phase>test</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.diffplug.spotless</groupId>
				<artifactId>spotless-maven-plugin</artifactId>
				<version>2.33.0</version>
				<dependencies>
					<dependency>
						<groupId>de.muenchen.oss</groupId>
						<artifactId>itm-java-codeformat</artifactId>
						<version>1.0.10</version>
					</dependency>
				</dependencies>
				<configuration>
					<java>
						<includes>
							<include>src/main/java/**/*.java</include> <!-- Check
							application code -->
							<include>src/test/java/**/*.java</include> <!-- Check
							application tests code -->
						</includes>
						<eclipse>
							<file>
								itm-java-codeformat/java_codestyle_formatter.xml</file>
						</eclipse>
						<trimTrailingWhitespace />
						<endWithNewline />
					</java>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<doclint>none</doclint>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
					<tagNameFormat>@{project.version}</tagNameFormat>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.2.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.10.1</version>
				</plugin>
				<plugin>
					<groupId>org.sonatype.central</groupId>
					<artifactId>central-publishing-maven-plugin</artifactId>
					<version>0.6.0</version>
					<extensions>true</extensions>
				</plugin>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.diffplug.spotless</groupId>
										<artifactId>spotless-maven-plugin</artifactId>
										<versionRange>[2,)</versionRange>
										<goals>
											<goal>check</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<!-- Deployment profile (required so these plugins are only used when
		deploying) -->

		<profile>
			<id>release</id>
			<build>
				<plugins>
					<!-- Source plugin -->
					<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>

					<!-- Javadoc plugin -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<doclint>none</doclint>
							<sourceFileIncludes>
								<sourceFileInclude>**/*.java</sourceFileInclude>
							</sourceFileIncludes>
						</configuration>
					</plugin>

					<!-- GPG plugin -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<configuration>
							<skip>${skipGpg}</skip>
						</configuration>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- Prevent `gpg` from using pinentry
									programs -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- publish to central -->
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<configuration>
							<autoPublish>true</autoPublish>
							<tokenAuth>true</tokenAuth>
							<deploymentName>${project.groupId}:${project.version}</deploymentName>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<licenses>
		<license>
			<name>MIT License</name>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Michael Prankl</name>
			<url>https://github.com/eidottermihi</url>
			<organization>Landeshauptstadt München</organization>
			<organizationUrl>https://github.com/it-at-m</organizationUrl>
			<roles>
				<role>developer</role>
			</roles>
		</developer>
	</developers>

</project>