<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.andreptb</groupId>
	<artifactId>andreptb-component-parent</artifactId>
	<version>0.5.0</version>
	<packaging>pom</packaging>
	<name>andreptb-component-parent</name>
	<description>Parent POM designed to provide common configuration for Maven component projects available on Maven Central</description>
	<url>https://github.com/andreptb/andreptb-component-parent</url>

	<properties>
		<maven.repo>${env.M2_REPO}/repository</maven.repo>
		<parent.pom.version>0.5.0</parent.pom.version>
		<parent.pom.artifactId>andreptb-component-parent</parent.pom.artifactId>
		<sourceConfigDirectory>${basedir}/src/config</sourceConfigDirectory>
		<configDependencyBasePath>${maven.repo}/com/github/andreptb/${parent.pom.artifactId}/${parent.pom.version}/${parent.pom.artifactId}-${parent.pom.version}</configDependencyBasePath>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<jacoco.version>0.7.5.201505241946</jacoco.version>
		<github.global.server>github</github.global.server>
	</properties>

	<developers>
		<developer>
			<name>Andre Albino Pereira</name>
			<url>https://github.com/andreptb</url>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>The MIT License (MIT)</name>
			<url>http://opensource.org/licenses/MIT</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:andreptb/andreptb-component-parent.git</connection>
		<developerConnection>scm:git:git@github.com:andreptb/andreptb-component-parent.git</developerConnection>
		<url>https://github.com/andreptb/andreptb-component-parent</url>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<name>Open Source Software Repository Hosting</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>
	
	<repositories>
		<!-- needed by com.github.github:site-maven-plugin -->
		<repository>
			<id>egit</id>
			<name>Eclipse egit</name>
			<url>https://repo.eclipse.org/content/repositories/egit-releases/</url>
		</repository>
	</repositories>	

	<profiles>
		<!-- profile enabled only for this parent pom, so config files can be referenced -->
		<profile>
			<id>uploadConfigFiles</id>
			<activation>
				<file>
					<exists>${sourceConfigDirectory}</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>1.9.1</version>
						<executions>
							<execution>
								<id>attach-artifacts</id>
								<phase>package</phase>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
								<configuration>
									<artifacts>
										<artifact>
											<file>${sourceConfigDirectory}/ci/maven-settings.xml</file>
											<type>xml</type>
											<classifier>mvn-settings</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/eclipse/java-formatter.xml</file>
											<type>xml</type>
											<classifier>java-formatter</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/eclipse/javascript-formatter.xml</file>
											<type>xml</type>
											<classifier>javascript-formatter</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/rules/checkstyle.xml</file>
											<type>xml</type>
											<classifier>checkstyle</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/rules/findbugs.xml</file>
											<type>xml</type>
											<classifier>findbugs</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/rules/pmd.xml</file>
											<type>xml</type>
											<classifier>pmd</classifier>
										</artifact>
										<artifact>
											<file>${sourceConfigDirectory}/site/site.xml</file>
											<type>xml</type>
											<classifier>site</classifier>
										</artifact>
									</artifacts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>childProjects</id>
			<activation>
				<file>
					<missing>${sourceConfigDirectory}</missing>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.marvinformatics.formatter</groupId>
						<artifactId>formatter-maven-plugin</artifactId>
						<version>1.6.0.RC4</version>
						<executions>
							<execution>
								<id>format-code</id>
								<goals>
									<goal>format</goal>
								</goals>
								<configuration>
									<configFile>${configDependencyBasePath}-java-formatter.xml</configFile>
									<configJsFile>${configDependencyBasePath}-javascript-formatter.xml</configJsFile>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.codehaus.plexus</groupId>
								<artifactId>plexus-utils</artifactId>
								<version>3.0.22</version>
							</dependency>
							<dependency>
								<groupId>${project.groupId}</groupId>
								<artifactId>${parent.pom.artifactId}</artifactId>
								<version>${parent.pom.version}</version>
								<classifier>java-formatter</classifier>
								<type>xml</type>
							</dependency>
							<dependency>
								<groupId>${project.groupId}</groupId>
								<artifactId>${parent.pom.artifactId}</artifactId>
								<version>${parent.pom.version}</version>
								<classifier>javascript-formatter</classifier>
								<type>xml</type>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-project-info-reports-plugin</artifactId>
						<version>2.8</version>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<phase>process-test-sources</phase>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.eluder.coveralls</groupId>
						<artifactId>coveralls-maven-plugin</artifactId>
						<version>4.0.0</version>
						<executions>
							<execution>
								<goals>
									<goal>report</goal>
								</goals>
								<phase>site-deploy</phase>
							</execution>
						</executions>						
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>2.4</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>2.10.3</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>findbugs-maven-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<includeFilterFile>${configDependencyBasePath}-findbugs.xml</includeFilterFile>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>${project.groupId}</groupId>
								<artifactId>${parent.pom.artifactId}</artifactId>
								<version>${parent.pom.version}</version>
								<classifier>findbugs</classifier>
								<type>xml</type>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<version>2.16</version>
						<configuration>
							<configLocation>${configDependencyBasePath}-checkstyle.xml</configLocation>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>${project.groupId}</groupId>
								<artifactId>${parent.pom.artifactId}</artifactId>
								<version>${parent.pom.version}</version>
								<classifier>checkstyle</classifier>
								<type>xml</type>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-pmd-plugin</artifactId>
						<version>3.5</version>
						<configuration>
							<rulesets>
								<ruleset>${configDependencyBasePath}-pmd.xml</ruleset>
							</rulesets>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>${project.groupId}</groupId>
								<artifactId>${parent.pom.artifactId}</artifactId>
								<version>${parent.pom.version}</version>
								<classifier>pmd</classifier>
								<type>xml</type>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>com.github.github</groupId>
						<artifactId>site-maven-plugin</artifactId>
						<version>0.12</version>
						<executions>
							<execution>
								<goals>
									<goal>site</goal>
								</goals>
								<phase>site-deploy</phase>
								<configuration>
									<message>Creating site for ${project.version}</message>
									<repositoryOwner>andreptb</repositoryOwner>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<reporting>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>findbugs-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-pmd-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jdepend-maven-plugin</artifactId>
						<version>2.0</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-report-plugin</artifactId>
						<version>2.18.1</version>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</reporting>
		</profile>
	</profiles>

	<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.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.4</version>
				<configuration>
					<skipDeploy>true</skipDeploy>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.doxia</groupId>
						<artifactId>doxia-module-markdown</artifactId>
						<version>1.6</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.5</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>nexus-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
