<?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.consolefire</groupId>
	<artifactId>jdbc-json-extension</artifactId>
	<version>1.4.0</version>
	<packaging>pom</packaging>
	<name>ConsoleFire > JDBC JSON Extension</name>
	<url>https://github.com/Consolefire/jdbc-json-extension</url>
	<description>
		`jdbc-json-extension` is to fetch data from RDBMS in JSON format. The data is structured the in the same relation structure of the Tables relationships in the database. The fetch is pre-planned using a `FetchPlan` configuration. The execution is multithreaded tree pattern where it starts from the `root` table with supplied filter parameters. The subsequent nodes (tables) are fetched as the `One-to-*` relationship defined from the root tables.
	</description>

	<licenses>
		<license>
			<name>Apache License Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<organization>
		<name>Consolefire</name>
		<url>http://consolefire.com</url>
	</organization>

	<developers>
		<developer>
			<name>Sabuj Das</name>
			<email>sabuj.das@gmail.com</email>
		</developer>
	</developers>
	<scm>
		<connection>scm:git:git://github.com/Consolefire/jdbc-json-extension</connection>
		<developerConnection>scm:git:ssh://github.com:Consolefire/jdbc-json-extension.git</developerConnection>
		<url>https://github.com/Consolefire/jdbc-json-extension/tree/master</url>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/Consolefire/jdbc-json-extension/issues</url>
	</issueManagement>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<java.version>1.8</java.version>
		<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
		<spring.cloud.version>Greenwich.SR1</spring.cloud.version>
		<lombok.version>1.18.6</lombok.version>
		<slf4j.version>1.7.26</slf4j.version>
		<fasterxml.jackson.version>2.9.8</fasterxml.jackson.version>
		<junit.platform.version>1.4.1</junit.platform.version>
		<junit5.version>5.3.1</junit5.version>
		<mockito.junit5.version>2.23.0</mockito.junit5.version>
		<surefire.version>2.22.1</surefire.version>
		<swagger2.version>2.8.0</swagger2.version>
		<checkstyle.plugin.version>3.0.0</checkstyle.plugin.version>
		<checkstyle.version>8.20</checkstyle.version>

		<bootrun.debug.port>17075</bootrun.debug.port>
		<bootrun.debug.suspend>n</bootrun.debug.suspend>
		<CONFIG_ROOT>${maven.multiModuleProjectDirectory}/config</CONFIG_ROOT>
		<skip.bootrepackage>false</skip.bootrepackage>
		<skip.bootrun>true</skip.bootrun>
		<!-- Github Properties -->
		<github.global.server>github</github.global.server>
	</properties>


	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
			<scope>compile</scope>
			<version>${lombok.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>provided</scope>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<scope>provided</scope>
			<version>${fasterxml.jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<scope>provided</scope>
			<version>${fasterxml.jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<scope>provided</scope>
			<version>${fasterxml.jackson.version}</version>
		</dependency>

		<!-- \/\/ JUnit 5 Dependencies !! DO NOT REMOVE version !! \/\/ -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit5.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit5.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<version>${mockito.junit5.version}</version>
			<scope>test</scope>
		</dependency>

		<!-- \/\/ JUnit 5 Dependencies needed for IDE execution !! DO NOT REMOVE 
			version !! \/\/ -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit5.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
			<version>${junit.platform.version}</version>
			<scope>test</scope>
		</dependency>
		<!-- /\/\ JUnit 5 Dependencies /\/\ -->
	</dependencies>



	<build>

		<plugins>
			<plugin>
				<artifactId>maven-site-plugin</artifactId>
				<configuration>
					<locales>en,fr</locales>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.0.1</version>
				<configuration>
					<attach>true</attach>
				</configuration>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>${checkstyle.plugin.version}</version>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<version>${checkstyle.version}</version>
					</dependency>
				</dependencies>
				<configuration>
					<skip>true</skip>
					<configLocation>${CONFIG_ROOT}/code/checkstyle/checkstyle.xml</configLocation>
					<encoding>UTF-8</encoding>
					<consoleOutput>false</consoleOutput>
					<linkXRef>false</linkXRef>
					<failsOnError>false</failsOnError>
					<failOnViolation>false</failOnViolation>
					<maxAllowedViolations>0</maxAllowedViolations>
				</configuration>
				<executions>
					<execution>
						<id>validate-code</id>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


	<profiles>
		<profile>
			<id>default</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<modules>
				<module>jdbc-json-extension-common</module>
				<module>jdbc-json-extension-core</module>
			</modules>
		</profile>

		<profile>
			<id>publish</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<modules>
				<module>jdbc-json-extension-common</module>
				<module>jdbc-json-extension-core</module>
			</modules>
			<distributionManagement>
				<repository>
					<id>internal</id>
					<url>file://${project.build.directory}/mvn-repo</url>
				</repository>
			</distributionManagement>
			<build>

				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<configuration>
							<keyname>${consolefire.gpg.keyname}</keyname>
							<passphraseServerId>${consolefire.gpg.keyname}</passphraseServerId>
						</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-deploy-plugin</artifactId>
						<version>2.8.2</version>
						<configuration>
							<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>

				</plugins>
			</build>

		</profile>

		<profile>
			<id>sample</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<modules>
				<module>jdbc-json-extension-common</module>
				<module>jdbc-json-extension-core</module>
				<module>jdbc-json-extension-sample</module>
			</modules>
			<dependencyManagement>
				<dependencies>
					<dependency>
						<!-- Import dependency management from Spring Boot -->
						<!-- Source: https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent -->
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-dependencies</artifactId>
						<version>${spring.boot.version}</version>
						<type>pom</type>
						<scope>import</scope>
					</dependency>
				</dependencies>
			</dependencyManagement>
			<build>
				<plugins>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<configuration>
							<skip>true</skip>
						</configuration>
						<executions>
							<execution>
								<id>build</id>
								<goals>
									<goal>repackage</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>docker</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<properties>
				<skip.bootrun>true</skip.bootrun>
				<skip.bootrepackage>false</skip.bootrepackage>
			</properties>
			<modules>
				<module>jdbc-json-extension-sample</module>
			</modules>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>io.fabric8</groupId>
							<artifactId>docker-maven-plugin</artifactId>
							<version>0.28.0</version>
							<dependencies>
								<dependency>
									<groupId>io.fabric8</groupId>
									<artifactId>run-java-sh</artifactId>
									<version>1.2.2</version>
								</dependency>
							</dependencies>

							<executions>
								<execution>
									<id>image-build</id>
									<phase>package</phase>
									<goals>
										<goal>build</goal>
									</goals>
									<configuration>
										<useColor>true</useColor>
										<registry>docker.io</registry>
										<verbose>true</verbose>
										<images>
											<image>
												<alias>${project.artifactId}</alias>
												<name>consolefire/jdbc-json-ext:${project.version}</name>
												<build>
													<from>java:8</from>
													<dockerFileDir>${CONFIG_ROOT}/docker/</dockerFileDir>
													<dockerFile>Dockerfile</dockerFile>
													<filter>@{*}</filter>
													<env>
														<JAVA_OPTS>-Djava.security.egd=file:/dev/./urandom</JAVA_OPTS>
													</env>
													<assembly>
														<basedir>/</basedir>
														<descriptor>${CONFIG_ROOT}/docker/assembly.xml</descriptor>
													</assembly>
												</build>
											</image>
										</images>
									</configuration>
								</execution>
								<execution>
									<id>image-push</id>
									<phase>deploy</phase>
									<goals>
										<goal>push</goal>
									</goals>
									<configuration>
										<pushRegistry>docker.io</pushRegistry>
										<verbose>true</verbose>
										<image>
											<alias>${project.artifactId}</alias>
											<name>consolefire/jdbc-json-ext:${project.version}</name>
										</image>
									</configuration>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
				<plugins>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<configuration>
							<executable>true</executable>
							<skip>${skip.bootrepackage}</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
