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

	<!-- OParent provides audits etc. -->
	<parent>
		<groupId>org.onap.oparent</groupId>
		<artifactId>oparent</artifactId>
		<version>2.0.0</version>
		<relativePath/>
	</parent>

	<!-- Portal SDK Maven parent project -->
	<groupId>org.onap.portal.sdk</groupId>
	<artifactId>epsdk-project</artifactId>
	<version>3.3.0-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>portal-sdk</name>
	<url>https://wiki.onap.org/display/DW/Portal</url>

	<modules>
		<module>epsdk-fw</module>
		<module>epsdk-core</module>
		<module>epsdk-analytics</module>
		<module>epsdk-domain</module>
		<module>epsdk-logger</module>
		<module>epsdk-aaf</module>
		<module>epsdk-music</module>
		<module>epsdk-workflow</module>
		<module>epsdk-app-common</module>
		<module>epsdk-app-overlay</module>
		<module>epsdk-app-os</module>
	</modules>

	<properties>
		<encoding>UTF-8</encoding>
		<springframework.version>4.3.24.RELEASE</springframework.version>
		<hibernate.version>4.3.11.Final</hibernate.version>
		<skiptests>false</skiptests>
		<nexusproxy>https://nexus.onap.org</nexusproxy>
		<snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
		<stagingNexusPath>content/repositories/staging/</stagingNexusPath>
		<releaseNexusPath>content/repositories/releases/</releaseNexusPath>
		<jacoco.version>0.7.9</jacoco.version>
		<sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions>
		<sonar.test.exclusions>**/test/**/*,**/tests/**/*</sonar.test.exclusions>
		<sonar.language>java</sonar.language>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.skipDesign>true</sonar.skipDesign>
		<sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
		<sonar.jacoco.reportPath>${project.basedir}/jacoco.exec</sonar.jacoco.reportPath>
		<sonar.jacoco.itReportPath>${project.basedir}/target/it-jacoco.exec</sonar.jacoco.itReportPath>
		<sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
		<sonar.projectVersion>${project.version}</sonar.projectVersion>
		<sonar.skipDesign>true</sonar.skipDesign>
		<sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
		<sonar.scm.exclusions.disabled>true</sonar.scm.exclusions.disabled>
	</properties>

	<!-- Specify the repositories here to avoid coordination of ~/.m2/settings.xml 
		files among developers. Use values (not properties) so oparent can 
		be resolved. The IDs should match Jenkins template values. -->
	<repositories>
		<repository>
			<id>releases</id>
			<name>ONAP - Release Repository</name>
			<url>https://nexus.onap.org/content/repositories/releases</url>
		</repository>
		<repository>
			<id>staging</id>
			<name>ONAP - Staging Repository</name>
			<url>https://nexus.onap.org/content/repositories/staging</url>
		</repository>
		<repository>
			<id>snapshots</id>
			<name>ONAP - Snapshot Repository</name>
			<url>https://nexus.onap.org/content/repositories/snapshots</url>
		</repository>
		<repository>
			<id>public</id>
			<url>https://nexus.onap.org/content/groups/public</url>
		</repository>
	</repositories>

	<!-- Specify the repositories here to avoid coordination of ~/.m2/settings.xml 
		files among all developers. Can use properties. -->
	<pluginRepositories>
		<pluginRepository>
			<id>onap-plugin-release</id>
			<url>${nexusproxy}/${releaseNexusPath}</url>
		</pluginRepository>
		<pluginRepository>
			<id>onap-plugin-staging</id>
			<url>${nexusproxy}/${stagingNexusPath}/</url>
		</pluginRepository>
		<pluginRepository>
			<id>onap-plugin-snapshots</id>
			<url>${nexusproxy}/${snapshotNexusPath}/</url>
		</pluginRepository>
	</pluginRepositories>

	<profiles>
		<!-- disable doclint, a new feature in Java 8, when generating javadoc -->
		<profile>
			<id>doclint-java8-disable</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<additionalparam>-Xdoclint:none</additionalparam>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

	</profiles>

	<build>

		<pluginManagement>
			<plugins>
				<!-- Silence Eclipse/m2e complaints about checkstyle plugin brought in 
					by OParent 
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-checkstyle-plugin</artifactId>
										<versionRange>2.17,)</versionRange>
										<goals>
											<goal>check</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore/>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				-->
				<!-- maven-site-plugin config is provided by OParent -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.6</version>
					<dependencies>
						<dependency>
							<groupId>org.apache.maven.wagon</groupId>
							<artifactId>wagon-webdav-jackrabbit</artifactId>
							<version>2.10</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<!-- version managed by oparent ${jacocoVersion}</version> -->
				<executions>
					<!-- disable jacoco executions from oparent -->
					<execution>
						<id>pre-unit-test</id>
						<phase>none</phase>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>none</phase>
					</execution>
					<execution>
						<id>pre-integration-test</id>
						<phase>none</phase>
					</execution>
					<execution>
						<id>post-integration-test</id>
						<phase>none</phase>
					</execution>
					<!-- Order matters -->
					<execution>
						<id>portal-prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<destFile>${sonar.jacoco.reportPath}</destFile>
						</configuration>
					</execution>
					<!-- offline instrumentation for PowerMock -->
					<execution>
						<id>portal-offline-instrument</id>
						<goals>
							<goal>instrument</goal>
						</goals>
					</execution>
					<execution>
						<id>portal-restore-instrumented-classes</id>
						<phase>test</phase>
						<goals>
							<goal>restore-instrumented-classes</goal>
						</goals>
					</execution>
					<execution>
						<id>portal-post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<dataFile>${sonar.jacoco.reportPath}</dataFile>
							<outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			</plugins>
		</pluginManagement>

		<plugins>

			<!-- Compile to Java 1.8 class output format -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

			<!-- Include project version in jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<archive>
						<manifestEntries>
							<archive-version>${project.version}</archive-version>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<!-- Generate javadoc jar; see profile for Java 8 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Generate source jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>

	</build>

	<distributionManagement>
		<!-- Override the OParent sections which use id "ecomp-releases" etc.
		     The IDs MUST match Jenkins template values. -->
		<repository>
			<id>releases</id>
			<name>ONAP - Release Repository</name>
			<url>${nexusproxy}/${releaseNexusPath}</url>
		</repository>
		<!-- no support for a "stagingRepository" -->
		<snapshotRepository>
			<id>snapshots</id>
			<name>ONAP - Snapshot Repository</name>
			<url>${nexusproxy}/${snapshotNexusPath}</url>
		</snapshotRepository>
		<!-- Javadocs -->
		<site>
			<id>ecomp-site</id>
			<url>dav:${nexusproxy}/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</url>
		</site>
	</distributionManagement>

</project>