<?xml version="1.0" encoding="UTF-8"?><!-- Copyright 2015-2017 floragunn 
	GmbH 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. -->

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

	<groupId>com.floragunn</groupId>
	<artifactId>sgctl</artifactId>
	<packaging>jar</packaging>
	<name>Search Guard Control Tool</name>
	<version>${revision}</version>

	<properties>
		<revision>master-SNAPSHOT</revision>
		<elasticsearch.version>8.15.2</elasticsearch.version>
		<sg.test-version>main-SNAPSHOT</sg.test-version>
		<maven.compiler.source>17</maven.compiler.source>
		<maven.compiler.target>17</maven.compiler.target>
		<maven.compiler.release>17</maven.compiler.release>
		<license.excludedGroups>.*floragunn.*</license.excludedGroups>
		<license.excludedScopes>test,provided</license.excludedScopes>
	</properties>

	<repositories>
		<repository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>release</id>
			<url>https://maven.search-guard.com/search-guard-flx-release</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>snapshot</id>
			<url>https://maven.search-guard.com/search-guard-flx-snapshot</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</repository>
        <repository>
            <id>util-release</id>
            <url>https://maven.search-guard.com:443/util</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
		<repository>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<id>third-party</id>
			<url>https://maven.search-guard.com:443/third-party</url>
		</repository>
		<repository>
			<id>elasticsearch-releases</id>
			<url>https://artifacts.elastic.co/maven</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
	<distributionManagement>
		<repository>
			<id>release</id>
			<name>Release repository</name>
			<url>https://maven.search-guard.com:443/search-guard-flx-release</url>
		</repository>
		<snapshotRepository>
			<id>snapshot</id>
			<name>Snapshot repository</name>
			<url>https://maven.search-guard.com:443/search-guard-flx-snapshot</url>
		</snapshotRepository>
	</distributionManagement>

	<dependencies>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>33.3.1-jre</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.guava</groupId>
					<artifactId>listenablefuture</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>commons-validator</groupId>
			<artifactId>commons-validator</artifactId>
			<version>1.9.0</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.14</version>
		</dependency>

		<dependency>
			<groupId>info.picocli</groupId>
			<artifactId>picocli</artifactId>
			<version>4.7.6</version>
		</dependency>

		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>codova</artifactId>
			<version>[1.0.0,)</version>
		</dependency>

		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>fluent-collections</artifactId>
			<version>[1.0.0,)</version>
		</dependency>

		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk18on</artifactId>
			<version>1.78.1</version>
		</dependency>

		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcpg-jdk18on</artifactId>
			<version>1.78.1</version>
		</dependency>

		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcpkix-jdk18on</artifactId>
			<version>1.78.1</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>2.18.0</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-yaml</artifactId>
			<version>2.18.0</version>
			<exclusions>
				<exclusion>
					<artifactId>jackson-databind</artifactId>
					<groupId>com.fasterxml.jackson.core</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>2.0.16</version>
		</dependency>
		
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
			<version>2.0.16</version>
		</dependency>

		<!-- ### Test Dependencies ### -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.11.2</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-migrationsupport</artifactId>
			<version>5.11.3</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.wiremock</groupId>
			<artifactId>wiremock</artifactId>
			<version>3.9.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<version>2.9.0</version>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch</groupId>
			<artifactId>elasticsearch</artifactId>
			<scope>test</scope>
			<version>${elasticsearch.version}</version>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch.plugin</groupId>
			<artifactId>lang-mustache</artifactId>
			<scope>test</scope>
			<version>${elasticsearch.version}</version>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch.plugin</groupId>
			<artifactId>percolator</artifactId>
			<version>${elasticsearch.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch.plugin</groupId>
			<artifactId>parent-join</artifactId>
			<version>${elasticsearch.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch.plugin</groupId>
			<artifactId>reindex</artifactId>
			<version>${elasticsearch.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.elasticsearch</groupId>
			<artifactId>elasticsearch-ssl-config</artifactId>
			<version>${elasticsearch.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.github.spullara.mustache.java</groupId>
			<artifactId>compiler</artifactId>
			<version>0.9.10</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>search-guard-flx-security</artifactId>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>
		
		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>search-guard-flx-ssl</artifactId>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>		

		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>search-guard-flx-support</artifactId>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>


		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>search-guard-flx-security</artifactId>
			<classifier>tests</classifier>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>

		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>dlic-search-guard-flx-security</artifactId>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>
		
		<dependency>
			<groupId>com.floragunn</groupId>
			<artifactId>dlic-search-guard-flx-fe-multi-tenancy</artifactId>
			<scope>test</scope>
			<version>${sg.test-version}</version>
		</dependency>		
	
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<scope>test</scope>
			<version>2.17.0</version>
		</dependency>

		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>2.24.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>2.24.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.12</version>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>default-report</id>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.13.0</version>
				<configuration>
					<showDeprecation>true</showDeprecation>
					<showWarnings>true</showWarnings>
					<annotationProcessorPaths>
						<path>
							<groupId>info.picocli</groupId>
							<artifactId>picocli-codegen</artifactId>
							<version>4.7.6</version>
						</path>
					</annotationProcessorPaths>
					<compilerArgs>
						<arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<argLine>-Xmx3072m ${surefireArgLine}</argLine>
					<includes>
						<include>**/*.java</include>
					</includes>
					<trimStackTrace>false</trimStackTrace>
					<classpathDependencyExcludes>
						<classpathDependencyExclude>org.apache.logging.log4j:log4j-to-slf4j</classpathDependencyExclude>
					</classpathDependencyExcludes>
					<forkCount>1</forkCount>
					<reuseForks>false</reuseForks>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.7.1</version>

				<executions>
					<execution>
						<id>sgctl</id>
						<phase>package</phase>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<tarLongFileMode>posix</tarLongFileMode>
							<outputDirectory>target/releases/</outputDirectory>
							<descriptors>
								<descriptor>src/main/assemblies/sgctl.xml</descriptor>
							</descriptors>
						</configuration>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>2.4.0</version>

				<executions>
					<execution>
						<id>sgctl-license</id>
						<configuration>
							<licenseMerges>
								<licenseMerge>Apache License, Version 2.0|Apache Public License 2.0|The Apache Software License, Version 2.0|Apache 2.0|The Apache Software License, version 2.0</licenseMerge>
								<licenseMerge>MIT License|The MIT License</licenseMerge>
							</licenseMerges>
						</configuration>
						<goals>
							<goal>add-third-party</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.6.0</version>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							<outputDirectory>target/releases/</outputDirectory>
							<shadedArtifactAttached>true</shadedArtifactAttached>
							<shadedClassifierName>shaded</shadedClassifierName>
							<minimizeJar>true</minimizeJar>
							<transformers>
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer" />
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<mainClass>com.floragunn.searchguard.sgctl.SgctlTool</mainClass>
								</transformer>
							</transformers>
							<createDependencyReducedPom>false</createDependencyReducedPom>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>module-info.class</exclude>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
									</excludes>
								</filter>
								<filter>
									<artifact>commons-logging:commons-logging</artifact>
									<includes>
										<include>**</include>
									</includes>
								</filter>
							</filters>
						</configuration>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.skife.maven</groupId>
				<artifactId>really-executable-jar-maven-plugin</artifactId>
				<version>2.1.1</version>
				<configuration>
					<classifier>shaded</classifier>
					<flags>-Xmx1G</flags>
					<programFile>./sgctl.sh</programFile>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>really-executable-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.6.0</version>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>${basedir}/target/releases/sgctl.sh</file>
									<type>sh</type>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
