<?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.github.research-virtualfortknox</groupId>
	<artifactId>msb-client-parent</artifactId>
	<version>1.0.7-RELEASE</version>
	<packaging>pom</packaging>
	
	<name>msb-client-websocket-java</name>
	<description>Parent pom providing dependency and plugin management for applications built with Maven</description>
	<url>https://research.virtualfortknox.de</url>

	<organization>
		<name>Fraunhofer IPA</name>
		<url>http://www.ipa.fraunhofer.de</url>
	</organization>

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

	<developers>
		<developer>
			<id>daniel-schel</id>
			<name>Daniel Schel</name>
			<url>https://github.com/daniel-schel</url>
			<organization>Fraunhofer IPA</organization>
			<organizationUrl>https://research.virtualfortknox.de</organizationUrl>
			<roles>
				<role>Maintainer</role>
			</roles>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git://github.com/research-virtualfortknox/msb-client-websocket-java.git</connection>
		<developerConnection>scm:git:ssh://github.com:research-virtualfortknox/msb-client-websocket-java.git</developerConnection>
		<url>https://github.com/research-virtualfortknox/msb-client-websocket-java</url>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<spring.version>5.3.19</spring.version>
		<tomcat.version>9.0.62</tomcat.version>
		<jackson.version>2.13.2</jackson.version>
		<jackson-databind.version>2.13.2.2</jackson-databind.version>
		<swagger.version>2.2.0</swagger.version>
		<swagger.parser.version>2.0.32</swagger.parser.version>
		<json-schema-validator.version>2.2.14</json-schema-validator.version>
		<slf4j.version>1.7.36</slf4j.version>
		<logback.version>1.2.11</logback.version>

		<junit-jupiter.version>5.8.2</junit-jupiter.version>
		<mockito.version>4.5.1</mockito.version>
		<jsonassert.version>1.5.0</jsonassert.version>

		<maven-assembly-plugin.version>3.1.1</maven-assembly-plugin.version>
		<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
		<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
		<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
		<maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
		<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
		<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
		<maven-site-plugin.version>3.8.2</maven-site-plugin.version>
		<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
		<maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
		<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
		<maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
		<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
		<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
		<dependency-check-maven.version>5.0.0</dependency-check-maven.version>

		<sonar.organization>research-virtualfortknox</sonar.organization>
		<sonar.host.url>https://sonarcloud.io</sonar.host.url>
	</properties>

	<modules>
		<module>msb-client-api</module>
		<module>msb-client-websocket</module>
		<module>coverage</module>
        <module>example</module>
    </modules>

	<build>
		<plugins>

			<!-- Enabling the use of Maven Site Plugin-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>${maven-site-plugin.version}</version>
				<executions>
					<!-- Enabling the use of the site descriptor of parent artifact for sub modules-->
					<execution>
						<id>attach-descriptor</id>
						<goals>
							<goal>attach-descriptor</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- To generate javadoc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven-source-plugin.version}</version>
				<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>${maven-javadoc-plugin.version}</version>
				<configuration>
					<source>8</source>
					<detectJavaApiLink>false</detectJavaApiLink>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- To generate coverage -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco-maven-plugin.version}</version>
				<executions>
					<!-- set arg line property for surefire -->
					<execution>
						<id>prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<!-- set arg line property for failsafe -->
					<execution>
						<id>prepare-agent-integration</id>
						<goals>
							<goal>prepare-agent-integration</goal>
						</goals>
						<configuration>
							<propertyName>failsafeArgLine</propertyName>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.eluder.coveralls</groupId>
				<artifactId>coveralls-maven-plugin</artifactId>
				<version>${coveralls-maven-plugin.version}</version>
				<dependencies>
					<dependency>
						<groupId>javax.xml.bind</groupId>
						<artifactId>jaxb-api</artifactId>
						<version>2.3.1</version>
					</dependency>
				</dependencies>
				<configuration>
					<jacocoReports>coverage/target/site/jacoco-aggregate-ut/jacoco.xml</jacocoReports>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${maven-surefire-plugin.version}</version>
				<configuration>
					<!-- Sets the VM argument line used when unit tests are run. -->
					<argLine>${surefireArgLine}</argLine>
				</configuration>
			</plugin>

		</plugins>
	</build>

	<profiles>
		<profile>
			<id>default</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<distributionManagement>
				<repository>
					<id>github</id>
					<name>GitHub Packages</name>
					<url>https://maven.pkg.github.com/research-virtualfortknox/msb-client-websocket-java</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>release</id>
			<distributionManagement>
				<repository>
					<id>ossrh</id>
					<name>Maven Central</name>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
				</repository>
			</distributionManagement>

			<build>
				<plugins>
					<!-- To sign release artifacts -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg-plugin.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- This is necessary for gpg to not try to use the pinentry programs -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<!-- Generate a project site documentation -->
	<reporting>
		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>${maven-project-info-reports-plugin.version}</version>
				<reportSets>
					<reportSet>
						<reports><!-- select reports -->
							<report>index</report>
							<report>summary</report>
							<report>dependency-info</report>
							<report>dependency-convergence</report>
							<report>distribution-management</report>
                            <report>licenses</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven-javadoc-plugin.version}</version>
				<reportSets>
					<reportSet><!-- by default, id = "default" -->
						<reports><!-- select non-aggregate reports -->
							<report>javadoc</report>
						</reports>
					</reportSet>
					<reportSet><!-- aggregate reportSet, to define in poms having modules -->
						<id>aggregate</id>
						<inherited>false</inherited><!-- don't run aggregate in child modules -->
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>${maven-dependency-plugin.version}</version>
				<reportSets>
					<reportSet>
						<reports>
							<report>analyze-report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<plugin>
				<groupId>org.owasp</groupId>
				<artifactId>dependency-check-maven</artifactId>
				<version>${dependency-check-maven.version}</version>
				<configuration>
					<skipProvidedScope>false</skipProvidedScope>
					<skipRuntimeScope>false</skipRuntimeScope>
					<nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>
					<rubygemsAnalyzerEnabled>false</rubygemsAnalyzerEnabled>
					<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
					<bundleAuditAnalyzerEnabled>false</bundleAuditAnalyzerEnabled>
				</configuration>
				<reportSets>
					<reportSet>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco-maven-plugin.version}</version>
				<reportSets>
					<reportSet>
						<reports>
							<!-- select non-aggregate reports -->
							<report>report-aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

		</plugins>
	</reporting>

</project>
