<?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>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>7</version>
	</parent>

	<groupId>com.mercateo.oss</groupId>
	<artifactId>oss-parent-pom</artifactId>
	<version>1.0.7</version>
	<packaging>pom</packaging>

	<organization>
		<name>Mercateo AG</name>
		<url>http://www.mercateo.com</url>
	</organization>

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

	<!-- Default value, should be overwritten in actual project -->
	<inceptionYear>2018</inceptionYear>

	<issueManagement>
		<system>github</system>
		<url>https://github.com/Mercateo/oss-parent-pom/issues</url>
	</issueManagement>

	<scm>
		<connection>scm:git:git@github.com:Mercateo/oss-parent-pom.git</connection>
		<developerConnection>scm:git:git@github.com:Mercateo/oss-parent-pom.git</developerConnection>
		<url>https://github.com/Mercateo/oss-parent-pom.git</url>
	  <tag>oss-parent-pom-1.0.7</tag>
  </scm>

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

	<build>
		<plugins>
			<plugin>
				<groupId>org.commonjava.maven.plugins</groupId>
				<artifactId>directory-maven-plugin</artifactId>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5.3</version>
					<configuration>
                    				<arguments>-Dossrh</arguments>
                			</configuration>
				</plugin>
				<plugin>
					<groupId>org.commonjava.maven.plugins</groupId>
					<artifactId>directory-maven-plugin</artifactId>
					<version>0.3.1</version>
					<executions>
						<execution>
							<id>directories</id>
							<goals>
								<goal>highest-basedir</goal>
							</goals>
							<phase>initialize</phase>
							<configuration>
								<property>repository.root</property>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.0.2</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								<addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Branch>${scmBranch}</Implementation-Branch>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eluder.coveralls</groupId>
					<artifactId>coveralls-maven-plugin</artifactId>
					<version>4.3.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<profiles>
		<profile>
			<id>oss.release-sign-artifacts</id>

			<activation>
				<property>
					<name>ossrh</name>
				</property>
			</activation>

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

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</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>
			<!-- Attach source-jar -->
			<id>oss-sourcejar</id>

			<activation>
				<file>
					<missing>.no-sourcejar</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>


		<profile>
			<!-- Attach test-jar -->
			<id>oss-testjar</id>

			<activation>
				<file>
					<missing>.no-testjar</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>test-jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<!-- Update license info in source files -->
			<id>oss-license-update</id>

			<activation>
				<file>
					<missing>.no-license</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
						<version>3.0</version>

						<configuration>
							<concurrencyFactor>4</concurrencyFactor>
							<strictCheck>true</strictCheck>
							<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
							<properties>
								<owner>${project.organization.name}</owner>
								<email>${project.organization.url}</email>
							</properties>
							<includes>
								<include>
									**/src/**/*.java
								</include>
								<include>
									**/src/**/*.kt
								</include>
							</includes>
							<mapping>
								<java>SLASHSTAR_STYLE</java>
								<kt>SLASHSTAR_STYLE</kt>
							</mapping>
						</configuration>

						<executions>
							<execution>
								<goals>
									<goal>format</goal>
								</goals>
								<id>update.license.headers</id>
								<phase>validate</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>


		<profile>
			<!-- Generate JavaDocs with -Xdoclint:none -->
			<id>oss-javadoc</id>

			<activation>
				<file>
					<missing>.no-javadoc</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>2.10.2</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<additionalparam>-Xdoclint:none</additionalparam>
								</configuration>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<!-- Check dependencies for known vulnerabilities -->
			<id>oss-owasp</id>

			<activation>
				<file>
					<missing>.no-owasp</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.owasp</groupId>
						<artifactId>dependency-check-maven</artifactId>
						<version>3.3.0</version>

						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>

						<configuration>
							<failOnError>true</failOnError>
							<failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
							<skipRuntimeScope>true</skipRuntimeScope>
							<skipProvidedScope>true</skipProvidedScope>
							<skipTestScope>true</skipTestScope>
							<skipSystemScope>true</skipSystemScope>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>oss-jacoco</id>

			<activation>
				<file>
					<missing>.no-jacoco</missing>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.2</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<excludes>
								<!-- Spring specific classes -->
								<exclude>**/*Configuration.*</exclude>
								<exclude>**/*Application.*</exclude>
								<!-- Exceptions -->
								<exclude>**/*Exception.*</exclude>
								<!-- proto-generated classes -->
								<exclude>**/gen/*</exclude>
								<exclude>**/generated/*</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>oss-formatter</id>

			<activation>
				<file>
					<exists>src/eclipse/config/eclipse_code_formatter.xml</exists>
				</file>
			</activation>

			<build>
				<plugins>
					<plugin>
						<groupId>net.revelc.code.formatter</groupId>
						<artifactId>formatter-maven-plugin</artifactId>
						<version>2.7.3</version>

						<configuration>
							<configFile>${repository.root}/src/eclipse/config/eclipse_code_formatter.xml</configFile>
						</configuration>
						<executions>
							<execution>
								<id>formatting</id>
								<goals>
									<goal>format</goal>
								</goals>
								<phase>process-sources</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
		        <id>oss-import-sorter</id>
            
			<activation>
				<file>
					<missing>.no-importsort</missing>
				</file>
			</activation>
            
			<build>
				<plugins>
					<plugin>
						<groupId>net.revelc.code</groupId>
						<artifactId>impsort-maven-plugin</artifactId>
						<version>1.2.0</version>
						<configuration>
							<groups>java.,javax.,org.,com.</groups>
							<staticGroups>java,*</staticGroups>
						</configuration>
						<executions>
							<execution>
								<id>sort-imports</id>
								<goals>
									<goal>sort</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

	</profiles>
</project>
  
