<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-build</artifactId>
		<version>4.3.0</version>
		<relativePath/><!-- lookup parent from repository -->
	</parent>

	<groupId>io.awspring.cloud</groupId>
	<artifactId>spring-cloud-aws</artifactId>
	<version>3.4.0</version>
	<packaging>pom</packaging>
	<name>Spring Cloud AWS</name>

	<scm>
		<url>https://github.com/awspring/spring-cloud-aws</url>
		<connection>scm:git:git://github.com/awspring/spring-cloud-aws.git
		</connection>
		<developerConnection>
			scm:git:ssh://git@github.com/awspring/spring-cloud-aws.git
		</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<properties>
		<spotless.version>2.40.0</spotless.version>
		<jacoco.version>0.8.8</jacoco.version>
		<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
		<wiremock-standalone.version>3.13.0</wiremock-standalone.version>
	</properties>

	<modules>
		<module>spring-cloud-aws-core</module>
		<module>spring-cloud-aws-autoconfigure</module>
		<module>spring-cloud-aws-dependencies</module>
		<module>spring-cloud-aws-docker-compose</module>
		<module>spring-cloud-aws-parameter-store</module>
		<module>spring-cloud-aws-secrets-manager</module>
		<module>spring-cloud-aws-ses</module>
		<module>spring-cloud-aws-sns</module>
		<module>spring-cloud-aws-sqs</module>
		<module>spring-cloud-aws-dynamodb</module>
		<module>spring-cloud-aws-s3</module>
		<module>spring-cloud-aws-testcontainers</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-dynamodb</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-metrics</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-parameter-store</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-s3</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-secrets-manager</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-ses</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-sns</module>
		<module>spring-cloud-aws-starters/spring-cloud-aws-starter-sqs</module>
		<module>spring-cloud-aws-samples</module>
		<module>spring-cloud-aws-test</module>
		<module>spring-cloud-aws-modulith</module>
		<module>docs</module>
    </modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.awspring.cloud</groupId>
				<artifactId>spring-cloud-aws-dependencies</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.wiremock</groupId>
				<artifactId>wiremock-standalone</artifactId>
				<version>${wiremock-standalone.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<compilerArgs>
							<!-- Enable all warnings -->
							<compilerArg>-Xlint:all</compilerArg>
							<!-- Disable options warning because we will have differences between the compiler and source code level-->
							<compilerArg>-Xlint:-options</compilerArg>
							<!-- Disable serialversionuid warnings -->
							<compilerArg>-Xlint:-serial</compilerArg>
							<!--compilerArg>-Werror</compilerArg-->
						</compilerArgs>
					</configuration>
				</plugin>
				<plugin>
					<groupId>com.diffplug.spotless</groupId>
					<artifactId>spotless-maven-plugin</artifactId>
					<version>${spotless.version}</version>
					<configuration>
						<java>
							<importOrder />
							<eclipse>
								<file>${maven.multiModuleProjectDirectory}/eclipse-code-formatter.xml</file>
							</eclipse>
							<removeUnusedImports/>
							<licenseHeader>
								<file>${maven.multiModuleProjectDirectory}/license-header.txt</file>
							</licenseHeader>
						</java>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<skip>true</skip>
					<links>
						<link>https://docs.oracle.com/javase/8/docs/api/</link>
						<link>https://javaee.github.io/javaee-spec/javadocs/</link>
						<link>https://fasterxml.github.io/jackson-core/javadoc/2.8/</link>
						<link>https://docs.spring.io/spring/docs/5.3.x/javadoc-api/</link>
					</links>
					<author>true</author>
					<header>${project.name}</header>
					<outputDirectory>${project.build.directory}/site/${project.version}/</outputDirectory>
					<source>17</source>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.diffplug.spotless</groupId>
				<artifactId>spotless-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>validate</phase>
						<configuration>
							<skip>${disable.checks}</skip>
						</configuration>
						<goals>
							<goal>apply</goal>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>spring</id>
			<repositories>
				<repository>
					<id>spring-snapshots</id>
					<name>Spring Snapshots</name>
					<url>https://repo.spring.io/libs-snapshot-local</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>false</enabled>
					</releases>
				</repository>
				<repository>
					<id>spring-milestones</id>
					<name>Spring Milestones</name>
					<url>https://repo.spring.io/libs-milestone-local</url>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>spring-snapshots</id>
					<name>Spring Snapshots</name>
					<url>https://repo.spring.io/libs-snapshot-local</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>false</enabled>
					</releases>
				</pluginRepository>
				<pluginRepository>
					<id>spring-milestones</id>
					<name>Spring Milestones</name>
					<url>https://repo.spring.io/libs-milestone-local</url>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg-plugin.version}</version>
						<configuration>
							<!-- Prevent gpg from using pinentry programs -->
							<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.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<skip>false</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>docs-classic</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<skip>false</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>coverage</id>
			<properties>
				<sonar.organization>awspring</sonar.organization>
				<sonar.projectKey>awspring_spring-cloud-aws</sonar.projectKey>

				<!-- https://community.sonarsource.com/t/project-quarkusio-quarkus-cant-have-2-modules-with-the-following-key-quarkusio-quarkus/33824/6 -->
				<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
				<sonar.host.url>https://sonarcloud.io</sonar.host.url>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>report</id>
								<goals>
									<goal>report</goal>
								</goals>
								<configuration>
									<formats>
										<format>XML</format>
									</formats>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<argLine>@{argLine} -Xms512m -Xmx512m</argLine>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<distributionManagement>
		<repository>
			<id>ossrh-awspring</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0</url>
			<comments>
				Copyright 2013-$YEAR the original author or authors.

				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

				https://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.
			</comments>
		</license>
	</licenses>
</project>
