<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License version 3 as published by
  ~ the Free Software Foundation.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<parent>
		<artifactId>crafter-commons</artifactId>
		<groupId>org.craftercms</groupId>
		<version>4.2.2</version><!-- craftercms version flag -->
	</parent>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>crafter-commons-utilities</artifactId>
	<name>Crafter Commons Utilities</name>
	<description>Crafter Commons Utilities</description>

	<dependencies>
		<!-- Commons -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-collections4</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.activation</groupId>
			<artifactId>jakarta.activation-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.eclipse.angus</groupId>
			<artifactId>angus-activation</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
		</dependency>

		<!-- Providers -->
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcpg-jdk18on</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- Optional -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-configuration2</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.angus</groupId>
			<artifactId>angus-mail</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-cbor</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>bson</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.yaml</groupId>
			<artifactId>snakeyaml</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>software.amazon.awssdk</groupId>
			<artifactId>s3</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>software.amazon.awssdk</groupId>
			<artifactId>s3-transfer-manager</artifactId>
		</dependency>
		<dependency>
			<groupId>com.box</groupId>
			<artifactId>box-java-sdk</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- BouncyCastle Provider -->
		<!-- This is required by the Box SDK, but it uses an older version -->
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk18on</artifactId>
		</dependency>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcpkix-jdk18on</artifactId>
		</dependency>

		<!-- WebDAV -->
		<dependency>
			<groupId>com.github.lookfirst</groupId>
			<artifactId>sardine</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- Groovy Sandbox -->
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>script-security</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- Testing -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>encryptionTool</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<environmentVariables>
								<TEST_ENV_PROPERTY1>CUSTOM_VALUE</TEST_ENV_PROPERTY1>
							</environmentVariables>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-shade-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>shade</goal>
								</goals>
								<configuration>
									<minimizeJar>true</minimizeJar>
									<shadedArtifactAttached>true
									</shadedArtifactAttached>
									<shadedClassifierName>enctool
									</shadedClassifierName>
									<createDependencyReducedPom>false
									</createDependencyReducedPom>
									<transformers>
										<transformer
											implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
											<mainClass>
												org.craftercms.commons.crypto.impl.EncryptionTool
											</mainClass>
										</transformer>
									</transformers>
									<filters>
										<!-- Excludes signatures from dependencies -->
										<filter>
											<artifact>*:*</artifact>
											<excludes>
												<exclude>META-INF/**
												</exclude>
												<exclude>
													module-info.class
												</exclude>
											</excludes>
										</filter>
										<filter>
											<artifact>
												org.aspectj:aspectjweaver
											</artifact>
											<excludes>
												<exclude>
													org/aspectj/lang/annotation/Aspect.class
												</exclude>
												<exclude>
													org/aspectj/lang/JoinPoint$StaticPart.class
												</exclude>
												<exclude>
													org/aspectj/runtime/internal/AroundClosure.class
												</exclude>
												<exclude>
													org/aspectj/lang/ProceedingJoinPoint.class
												</exclude>
												<exclude>
													org/aspectj/lang/Signature.class
												</exclude>
												<exclude>
													org/aspectj/lang/JoinPoint.class
												</exclude>
												<exclude>
													org/aspectj/lang/JoinPoint$EnclosingStaticPart.class
												</exclude>
												<exclude>
													org/aspectj/lang/annotation/Around.class
												</exclude>
												<exclude>
													org/aspectj/lang/reflect/SourceLocation.class
												</exclude>
												<exclude>
													org/aspectj/lang/JoinPoint.class
												</exclude>
												<exclude>
													org/aspectj/lang/reflect/MethodSignature.class
												</exclude>
												<exclude>
													org/aspectj/lang/reflect/CodeSignature.class
												</exclude>
												<exclude>
													org/aspectj/lang/reflect/MemberSignature.class
												</exclude>
											</excludes>
										</filter>
										<filter>
											<artifact>
												org.slf4j:jcl-over-slf4j
											</artifact>
											<excludes>
												<exclude>
													org/apache/commons/logging/Log.class
												</exclude>
												<exclude>
													org/apache/commons/logging/LogConfigurationException.class
												</exclude>
												<exclude>
													org/apache/commons/logging/impl/NoOpLog.class
												</exclude>
												<exclude>
													org/apache/commons/logging/LogFactory.class
												</exclude>
											</excludes>
										</filter>
									</filters>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
