<?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
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>com.xekm</groupId>
	<artifactId>hello-world</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<dropwizard.version>1.3.12</dropwizard.version>
		<javax-activation.version>1.1.1</javax-activation.version>
		<jaxb.version>2.3.0</jaxb.version>
		<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
		<mongojack.version>2.9.4</mongojack.version>
		<postgres-jdbc.version>42.7.2</postgres-jdbc.version>
		<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
		<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
		<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
		<main.class>com.example.helloworld.HelloWorldService</main.class>
		<hibernate.version>5.4.24.Final</hibernate.version>
	</properties>

	<profiles>
		<profile>
			<id>mysql</id>
			<dependencies>
				<dependency>
					<groupId>mysql</groupId>
					<artifactId>mysql-connector-java</artifactId>
					<version>${mysql-connector-java.version}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>mongo</id>
			<properties>
				<main.class>com.example.helloworld.HelloMongoService</main.class>
			</properties>
		</profile>
		<profile>
			<id>postgres</id>
			<dependencies>
				<dependency>
					<groupId>org.postgresql</groupId>
					<artifactId>postgresql</artifactId>
					<version>${postgres-jdbc.version}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>jdbi</id>
			<properties>
				<main.class>com.example.helloworld.HelloJDBIService</main.class>
			</properties>
		</profile>
	</profiles>

	<dependencies>
		<dependency>
			<groupId>io.dropwizard</groupId>
			<artifactId>dropwizard-core</artifactId>
			<version>${dropwizard.version}</version>
		</dependency>
		<dependency>
			<groupId>io.dropwizard</groupId>
			<artifactId>dropwizard-hibernate</artifactId>
			<version>${dropwizard.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.apache.geronimo.specs</groupId>
					<artifactId>geronimo-jta_1.1_spec</artifactId>
				</exclusion>
				<exclusion>
					<groupId>javax.transaction</groupId>
					<artifactId>jta</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>io.dropwizard</groupId>
			<artifactId>dropwizard-jdbi3</artifactId>
			<version>${dropwizard.version}</version>
		</dependency>
		<dependency>
			<groupId>io.dropwizard</groupId>
			<artifactId>dropwizard-views-mustache</artifactId>
			<version>${dropwizard.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mongojack</groupId>
			<artifactId>mongojack</artifactId>
			<version>${mongojack.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.fasterxml.jackson.core</groupId>
					<artifactId>jackson-databind</artifactId>
				</exclusion>
				<exclusion>
					<groupId>javax.persistence</groupId>
					<artifactId>persistence-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>${jaxb.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
			<version>${javax-activation.version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
				<configuration>
					<debug>false</debug>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${maven-jar-plugin.version}</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>${maven-shade-plugin.version}</version>
				<configuration>
					<createDependencyReducedPom>true</createDependencyReducedPom>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<mainClass>${main.class}</mainClass>
								</transformer>
							</transformers>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
