<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>eu.simstadt</groupId>
	<artifactId>region-chooser</artifactId>
	<version>0.2.1-SNAPSHOT</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
		<junit-jupiter.version>5.6.0</junit-jupiter.version>
	</properties>

	<scm>
		<connection>scm:git:file://${project.baseUri}/.git</connection>
		<developerConnection>scm:git:file://${project.baseUri}/.git</developerConnection>
	</scm>

	<dependencies>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit-jupiter.version}</version>
			<scope>test</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.osgeo/proj4j -->
		<dependency>
			<groupId>org.osgeo</groupId>
			<artifactId>proj4j</artifactId>
			<version>0.1.0</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.locationtech.jts/jts-core -->
		<dependency>
			<groupId>org.locationtech.jts</groupId>
			<artifactId>jts-core</artifactId>
			<version>1.16.1</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/com.ximpleware/vtd-xml -->
		<dependency>
			<groupId>com.ximpleware</groupId>
			<artifactId>vtd-xml</artifactId>
			<version>2.13.4</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<!-- Gets info from git, e.g. hash and datetime -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<timestampFormat>{0,date,yyyyMMdd}</timestampFormat>
					<shortRevisionLength>7</shortRevisionLength>
					<doCheck>false</doCheck>
					<doUpdate>false</doUpdate>
				</configuration>
			</plugin>

			<!-- Packs everything in a zip -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>regionchooser</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>${basedir}/buildConfig/assemblyDesc.xml</descriptor>
							</descriptors>
							<finalName>RegionChooser_${project.version}_${scmBranch}_${timestamp}_${buildNumber}</finalName>
							<appendAssemblyId>false</appendAssemblyId>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<mainClass>eu.simstadt.regionchooser.RegionChooserFX</mainClass>
						</manifest>
						<manifestEntries>
							<Implementation-URL>http://simstadt.hft-stuttgart.de/</Implementation-URL>
							<Implementation-Version>${project.version} (${scmBranch}, rev. ${buildNumber}, ${timestamp})</Implementation-Version>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.2</version>
				<configuration>
					<testFailureIgnore>true</testFailureIgnore>
				</configuration>
				<executions>
					<execution>
						<id>default-test</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.2</version>
				<executions>
					<execution>
						<id>default-prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>default-report</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>


					<!-- attached to Maven test phase -->
					<execution>
						<id>report</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
