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

	<parent>
		<groupId>one.microstream</groupId>
		<artifactId>microstream-storage-rest-parent</artifactId>
		<version>08.01.01-MS-GA</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>microstream-storage-restclient-app</artifactId>
	
	<name>MicroStream Storage REST Client App</name>
	<description>Executable Client App with Web User Interface</description>
	<url>https://microstream.one</url>

	<properties>
		<vaadin.version>14.8.9</vaadin.version>
		<spring.boot.version>2.6.7</spring.boot.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-bom</artifactId>
				<version>${vaadin.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring.boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>one.microstream</groupId>
			<artifactId>microstream-storage-restclient-jersey</artifactId>
			<version>08.01.01-MS-GA</version>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>flow-server-compatibility-mode</artifactId>
		</dependency>
	</dependencies>

	<build>
		<defaultGoal>spring-boot:run</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>${spring.boot.version}</version>
				<configuration>
					<mainClass>one.microstream.storage.restclient.app.types.Application</mainClass>
					<!-- Clean build and startup time for Vaadin apps sometimes may exceed 
						the default Spring Boot's 30sec timeout. -->
					<wait>500</wait>
					<maxAttempts>240</maxAttempts>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>production</id>
			<properties>
				<vaadin.productionMode>true</vaadin.productionMode>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<version>${spring.boot.version}</version>
						<configuration>
							<mainClass>one.microstream.storage.restclient.app.types.Application</mainClass>
							<jvmArguments>-Dvaadin.productionMode</jvmArguments>
							<layout>JAR</layout>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>repackage</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
