<?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>de.alpharogroup</groupId>
		<artifactId>mvn-parent-projects</artifactId>
		<version>2.1</version>
	</parent>

	<artifactId>mvn-java-api-parent</artifactId>
	<version>1.1</version>
	<packaging>pom</packaging>
	<inceptionYear>2018</inceptionYear>

	<name>${project.artifactId}</name>

	<description>
		Parent project for general java projects.
	</description>

	<url>https://github.com/lightblueseas/${project.artifactId}</url>

	<properties>
		<!-- LOMBOK version -->
		<lombok.version>1.18.6</lombok.version>
		<!-- MAVEN PLUGIN versions -->
		<!-- MAVEN-ANTRUN-PLUGIN version -->
		<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
		<!-- MAVEN-PMD-PLUGIN version -->
		<maven-pmd-plugin.version>3.10.0</maven-pmd-plugin.version>
		<!-- MAVEN-SUREFIRE-PLUGIN version -->
		<maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
		<!-- MAVEN-TOOLCHAINS-PLUGIN version -->
		<maven-toolchains-plugin.version>1.1</maven-toolchains-plugin.version>
		<!-- COBERTURA-MAVEN-PLUGIN version -->
		<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
		<!-- COVERAGE-MAVEN-PLUGIN version -->
		<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
		<!-- EXEC-MAVEN-PLUGIN version -->
		<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
		<!-- LICENSE-MAVEN-PLUGIN version -->
		<license-maven-plugin.version>3.0</license-maven-plugin.version>
		<!-- LOMBOK-MAVEN-PLUGIN version -->
		<lombok-maven-plugin.version>1.18.6.0</lombok-maven-plugin.version>
		<!-- PROPERTIES-MAVEN-PLUGIN version -->
		<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
	</properties>

	<scm>
		<connection>scm:git:git:@github.com:lightblueseas/${project.artifactId}.git</connection>
		<developerConnection>scm:git:git@github.com:lightblueseas/${project.artifactId}.git</developerConnection>
		<url>git:@github.com:lightblueseas/${project.artifactId}.git</url>
	</scm>

	<issueManagement>
		<system>github</system>
		<url>https://github.com/lightblueseas/${project.artifactId}/issues</url>
	</issueManagement>

	<ciManagement>
		<system>travis-ci</system>
		<url>https://travis-ci.org/lightblueseas/${project.artifactId}</url>
	</ciManagement>

	<build>

		<resources>

			<resource>
				<filtering>false</filtering>
				<directory>src/main/java</directory>
				<includes>
					<include>**</include>
				</includes>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/package.html</exclude>
				</excludes>
			</resource>

			<resource>
				<filtering>false</filtering>
				<directory>src/main/resources</directory>
			</resource>

			<resource>
				<filtering>false</filtering>
				<directory>src/site</directory>
			</resource>

		</resources>

		<testResources>

			<testResource>
				<filtering>false</filtering>
				<directory>src/test/java</directory>
				<includes>
					<include>**</include>
				</includes>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/package.html</exclude>
				</excludes>
			</testResource>
			<testResource>
				<filtering>false</filtering>
				<directory>src/test/resources</directory>
			</testResource>

		</testResources>

		<pluginManagement>

			<plugins>

				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>${license-maven-plugin.version}</version>
					<configuration>
						<header>src/main/resources/LICENSE.txt</header>
						<properties>
							<owner>Asterios Raptis</owner>
							<year>${project.inceptionYear}</year>
							<email>asterios.raptis@gmx.net</email>
						</properties>
						<excludes>
							<exclude>**/README</exclude>
							<exclude>**/README.md</exclude>
							<exclude>**/LICENSE</exclude>
							<exclude>**/NOTICE</exclude>
							<exclude>**/pom.xml</exclude>
							<exclude>**/pom.xml.bak</exclude>
							<exclude>**/*.xml</exclude>
							<exclude>**/*.xsl</exclude>
							<exclude>**/*.xsd</exclude>
							<exclude>**/*.dtd</exclude>
							<exclude>**/*.html</exclude>
							<exclude>**/*.jsp</exclude>
							<exclude>**/*.jpa</exclude>
							<exclude>**/*.sql</exclude>
							<exclude>**/*.properties</exclude>
							<exclude>**/*.bat</exclude>
							<exclude>**/*.gradle</exclude>
							<exclude>**/*.MF</exclude>
							<exclude>**/*.txt</exclude>
							<exclude>**/*.vm</exclude>
							<exclude>**/*.log</exclude>
							<exclude>**/*.map</exclude>
							<exclude>**/*.js.map</exclude>
							<exclude>**/*.tmpl</exclude>
							<exclude>**/*.js.tmpl</exclude>
							<exclude>**/*.editorconfig</exclude>
							<exclude>**/*.versionsBackup</exclude>
							<exclude>**/*.launch</exclude>
							<exclude>src/test/resources/**</exclude>
							<exclude>src/main/resources/**</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>format</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<inherited>true</inherited>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin.version}</version>
				</plugin>

				<plugin>
					<inherited>true</inherited>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>${maven-antrun-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.eluder.coveralls</groupId>
					<artifactId>coveralls-maven-plugin</artifactId>
					<version>${coveralls-maven-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>cobertura-maven-plugin</artifactId>
					<version>${cobertura-maven-plugin.version}</version>
					<configuration>
						<format>xml</format>
						<maxmem>256m</maxmem>
						<!-- aggregated reports for multi-module projects -->
						<aggregate>true</aggregate>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-pmd-plugin</artifactId>
					<version>${maven-pmd-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>properties-maven-plugin</artifactId>
					<version>${properties-maven-plugin.version}</version>
				</plugin>
				<!--This plugin is used to execute java classes with a main method. -->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>${exec-maven-plugin.version}</version>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>java</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<!--This plugin is used to delombok lombokified java classes if this 
					is needed. -->
				<plugin>
					<groupId>org.projectlombok</groupId>
					<artifactId>lombok-maven-plugin</artifactId>
					<version>${lombok-maven-plugin.version}</version>
					<executions>
						<execution>
							<phase>generate-sources</phase>
							<goals>
								<goal>delombok</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-toolchains-plugin</artifactId>
					<version>${maven-toolchains-plugin.version}</version>
				</plugin>

			</plugins>

		</pluginManagement>

		<plugins>

			<plugin>
				<inherited>true</inherited>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>

		</plugins>

	</build>

	<profiles>

		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<!-- This profile is for generate or update the license header from source 
				files. for generate or update the license header you have to run this profile 
				with this goal license:format. -->
			<id>update-license-header</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>

					<plugin>
						<inherited>true</inherited>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
					</plugin>

				</plugins>
			</build>

		</profile>

		<profile>
			<id>release-javadoc-jar-with-dependencies</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>

					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>

					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-assembly-plugin</artifactId>
					</plugin>

				</plugins>
			</build>
		</profile>

		<profile>
			<id>generate-reports</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>

					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-surefire-plugin</artifactId>
					</plugin>

				</plugins>
			</build>
		</profile>

		<profile>
			<id>delombok-src</id>
			<!-- This profile can generate the classes(with all getter and setter 
				and other methods that provide lombok) that uses lombok annotations with 
				the maven-antrun-plugin. -->
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<dependencies>
							<!-- LOMBOK DEPENDENCIES -->
							<dependency>
								<groupId>org.projectlombok</groupId>
								<artifactId>lombok</artifactId>
								<version>${lombok.version}</version>
							</dependency>
							<dependency>
								<groupId>com.sun</groupId>
								<artifactId>tools</artifactId>
								<version>${com.sun-tools.version}</version>
								<scope>system</scope>
								<systemPath>${system-path-of-tools-jar}</systemPath>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>delombok</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<property environment="env"></property>
									<property name="antLombokVersion"
										value="${lombok.version}"></property>
									<target name="javadoc">
										<taskdef
											classname="lombok.delombok.ant.Tasks$Delombok"
											classpath="${env.HOME}/.m2/repository/org/projectlombok/lombok/${antLombokVersion}/lombok-${antLombokVersion}.jar"
											name="delombok"></taskdef>
										<delombok encoding="UTF-8" from="src/main/java"
											to="target/generated-sources/delombok" verbose="true">
											<format value="suppressWarnings:skip"></format>
										</delombok>
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>

		</profile>

		<profile>
			<id>delombok-tests</id>
			<!-- This profile can generate the classes(with all getter and setter 
				and other methods that provide lombok) that uses lombok annotations with 
				the maven-antrun-plugin. -->
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<dependencies>
							<!-- LOMBOK DEPENDENCIES -->
							<dependency>
								<groupId>org.projectlombok</groupId>
								<artifactId>lombok</artifactId>
								<version>${lombok.version}</version>
							</dependency>
							<dependency>
								<groupId>com.sun</groupId>
								<artifactId>tools</artifactId>
								<version>${com.sun-tools.version}</version>
								<scope>system</scope>
								<systemPath>${system-path-of-tools-jar}</systemPath>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>delombok</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<property environment="env"></property>
									<property name="antLombokVersion"
										value="${lombok.version}"></property>
									<target name="javadoc">
										<taskdef
											classname="lombok.delombok.ant.Tasks$Delombok"
											classpath="${env.HOME}/.m2/repository/org/projectlombok/lombok/${antLombokVersion}/lombok-${antLombokVersion}.jar"
											name="delombok"></taskdef>
										<delombok encoding="UTF-8" from="src/test/java"
											to="target/generated-sources/test-delombok" verbose="true">
											<format value="suppressWarnings:skip"></format>
										</delombok>
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>

		</profile>

		<profile>
			<id>code-coverage-cobertura-html-reporting</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>

			<build>

				<plugins>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>cobertura-maven-plugin</artifactId>
						<configuration>
							<format>html</format>
							<maxmem>512m</maxmem>
							<!-- aggregated reports for multi-module projects -->
							<aggregate>true</aggregate>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.eluder.coveralls</groupId>
						<artifactId>coveralls-maven-plugin</artifactId>
					</plugin>

				</plugins>

			</build>

			<reporting>

				<plugins>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>cobertura-maven-plugin</artifactId>
						<configuration>
							<format>html</format>
							<maxmem>512m</maxmem>
							<!-- aggregated reports for multi-module projects -->
							<aggregate>true</aggregate>
						</configuration>
					</plugin>

				</plugins>

			</reporting>

		</profile>

	</profiles>

</project>
