<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>
	<name>Slothsoft Charts</name>
	<description>A framework for creating charts.</description>
	<url>https://github.com/slothsoft/charts</url>

	<groupId>de.slothsoft.charts</groupId>
	<artifactId>build</artifactId>
	<version>0.2.1</version>
	<packaging>pom</packaging>

	<modules>
		<module>bom</module>
		<module>charts</module>
		<module>examples</module>
		<module>examples-generator</module>
		<module>gui-tests</module>
		<module>swing-charts</module>
		<module>swt-charts</module>
		<module>test-reports</module>
	</modules>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<manifest.location>${project.build.directory}/META-INF</manifest.location>

		<swt.version>4.3</swt.version>
		<batik.version>1.12</batik.version>
	</properties>

	<repositories>
		<repository>
			<id>maven-eclipse-repo</id>
			<url>http://maven-eclipse.github.io/maven</url>
		</repository>
	</repositories>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>charts</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>examples</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>examples-generator</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>gui-tests</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>swing-charts</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>de.slothsoft.charts</groupId>
				<artifactId>swt-charts</artifactId>
				<version>${project.version}</version>
			</dependency>

			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.12</version>
			</dependency>

			<dependency>
				<groupId>org.eclipse.swt</groupId>
				<artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
				<version>${swt.version}</version>
			</dependency>

			<dependency>
			    <groupId>org.apache.xmlgraphics</groupId>
			    <artifactId>batik-codec</artifactId>
				<version>${batik.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.xmlgraphics</groupId>
				<artifactId>batik-dom</artifactId>
				<version>${batik.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.xmlgraphics</groupId>
				<artifactId>batik-svggen</artifactId>
				<version>${batik.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.xmlgraphics</groupId>
				<artifactId>batik-transcoder</artifactId>
				<version>${batik.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>

				<!-- This plug-in adds OSGi properties to manifest -->

				<plugin>
					<groupId>org.apache.felix</groupId>
					<artifactId>maven-bundle-plugin</artifactId>
					<version>4.2.1</version>
					<extensions>true</extensions>
					<executions>
						<execution>
							<id>bundle-manifest</id>
							<phase>process-classes</phase>
							<goals>
								<goal>manifest</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<manifestLocation>${manifest.location}</manifestLocation>
						<supportedProjectTypes>
							<supportedProjectType>jar</supportedProjectType>
						</supportedProjectTypes>
						<instructions>
							<Bundle-Version>${project.version}</Bundle-Version>
							<Bundle-Name>${project.name} Plug-in</Bundle-Name>
						</instructions>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.0.0-M1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.22.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.1.1</version><!-- 3.1.2+ leads to unkown error: Bug 547340 -->
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-report-plugin</artifactId>
					<version>2.4.2</version> <!-- newer versions don't generate CSS -->
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.6.0</version>
				</plugin>

				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.5</version>
				</plugin>

				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.7</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>

			<!-- The next three plug-ins hook Jacoco to the test engines -->

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<argLine>${surefireArgLine}</argLine>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<id>integration-test</id>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<configuration>
							<argLine>${failsafeArgLine}</argLine>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>prepare-agent-integration</id>
						<goals>
							<goal>prepare-agent-integration</goal>
						</goals>
						<configuration>
							<propertyName>failsafeArgLine</propertyName>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<excludes>
						<exclude>de/slothsoft/charts/test/**</exclude>
					</excludes>
				</configuration>
			</plugin>

			<!-- Create an aggregated JUnit report -->

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<executions>
					<execution>
						<id>create-junit-report</id>
						<phase>verify</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<aggregate>true</aggregate>
							<outputName>index</outputName>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- The following plug-ins are for the release -->

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<executions>
					<execution>
						<id>default-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<localCheckout>true</localCheckout>
					<pushChanges>false</pushChanges>
					<mavenExecutorId>forked-path</mavenExecutorId>
					<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
					<tagNameFormat>@{project.version}</tagNameFormat>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<artifactId>maven-scm-provider-gitexe</artifactId>
						<version>1.9.5</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadoc</id>
						<goals>
							<goal>javadoc</goal>
						</goals>
						<phase>install</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<!-- We want to deploy to Sonatype -->

	<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>

	<scm>
		<connection>scm:git:git://github.com/slothsoft/charts.git</connection>
		<developerConnection>scm:git:git@github.com/slothsoft/charts.git</developerConnection>
		<url>https://github.com/slothsoft/charts</url>
		<tag>0.2.1</tag>
	</scm>

	<profiles>

		<!-- Profile to create Documentation (JavaDoc, JUnit, Jacoco, Wiki) -->

		<profile>
			<id>doc</id>
			<build>
				<plugins>

					<!-- Clear the docs folder so we don't get artefacts of deleted classes -->

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-clean-plugin</artifactId>
						<configuration>
							<filesets>
								<fileset>
									<directory>docs/</directory>
								</fileset>
							</filesets>
						</configuration>
					</plugin>

					<!-- Configure the JavaDoc Plug-in so we publish it via GitHub Pages -->

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<source>8</source>
							<quiet>true</quiet>
							<locale>en</locale>
							<notimestamp>true</notimestamp>
							<windowtitle>${project.name}</windowtitle>
							<doctitle>${project.name}</doctitle>
						</configuration>
						<executions>
							<execution>
								<id>aggregate</id>
								<phase>package</phase>
								<goals>
									<goal>aggregate</goal>
								</goals>
								<configuration>
									<show>public</show>
									<sourceFileIncludes>de/slothsoft/**/*.java</sourceFileIncludes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- This profile is for signing the JARs before uploading -->

		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<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>
				</plugins>
			</build>
		</profile>
	</profiles>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>https://opensource.org/licenses/MIT</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>sschulz</id>
			<name>Stef Schulz</name>
			<email>s.schulz@slothsoft.de</email>
		</developer>
	</developers>
</project>