<?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>

	<!--
	mvn clean
	mvn compile
	mvn release:xxx -Pode4j-release
	-->

	<groupId>org.ode4j</groupId>
	<artifactId>parent</artifactId>
	<version>0.5.2</version>
	<packaging>pom</packaging>

	<modules>
		<module>core</module>
		<module>core-cpp</module>
		<module>demo</module>
		<module>demo-cpp</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<ode4j.bnd-maven-plugin.version>6.4.0</ode4j.bnd-maven-plugin.version>
		<ode4j.build-helper-maven-plugin.version>3.3.0</ode4j.build-helper-maven-plugin.version>
		<ode4j.maven-clean-plugin.version>3.2.0</ode4j.maven-clean-plugin.version>
		<ode4j.maven-compiler-plugin.version>3.11.0</ode4j.maven-compiler-plugin.version>
		<ode4j.maven-deploy-plugin.version>3.1.1</ode4j.maven-deploy-plugin.version>
		<ode4j.maven-enforcer-plugin.version>3.3.0</ode4j.maven-enforcer-plugin.version>
		<ode4j.maven-gpg-plugin.version>3.0.1</ode4j.maven-gpg-plugin.version>
		<ode4j.maven-install-plugin.version>3.1.1</ode4j.maven-install-plugin.version>
		<ode4j.maven-jar-plugin.version>3.3.0</ode4j.maven-jar-plugin.version>
		<ode4j.maven-javadoc-plugin.version>3.5.0</ode4j.maven-javadoc-plugin.version>
		<ode4j.maven-plugin-plugin.version>3.8.2</ode4j.maven-plugin-plugin.version>
		<ode4j.maven-resources-plugin.version>3.3.1</ode4j.maven-resources-plugin.version>
		<ode4j.maven-source-plugin.version>3.2.1</ode4j.maven-source-plugin.version>
		<ode4j.maven-surefire-plugin.version>3.0.0</ode4j.maven-surefire-plugin.version>
		<ode4j.nexus-staging-maven-plugin.version>1.6.13</ode4j.nexus-staging-maven-plugin.version>
	</properties>

	<name>ODE for Java</name>
	<description>Java 3D Physics Engine and Library.</description>
	<url>https://github.com/tzaeschke/ode4j</url>

	<licenses>
		<license>
			<name>GNU Lesser General Public License</name>
			<url>http://www.gnu.org/licenses/lgpl.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<url>https://github.com/tzaeschke/ode4j</url>
		<connection>scm:git:git@github.com:tzaeschke/ode4j.git</connection>
		<developerConnection>scm:git:git@github.com:tzaeschke/ode4j.git</developerConnection>
	  <tag>parent-0.5.2</tag>
  </scm>

	<developers>
		<developer>
			<name>Tilmann Zäschke</name>
			<id>tzaeschke</id>
			<email>zoodb@gmx.de</email>
		</developer>
	</developers>

	<issueManagement>
		<system>github</system>
		<url>https://github.com/tzaeschke/ode4j/issues</url>
	</issueManagement>

<!--	<repositories>-->
<!--		<repository>-->
<!--			<id>sonatype-snapshots</id>-->
<!--			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>-->
<!--			<releases>-->
<!--				<enabled>false</enabled>-->
<!--			</releases>-->
<!--			<snapshots>-->
<!--				<enabled>true</enabled>-->
<!--			</snapshots>-->
<!--		</repository>-->
<!--	</repositories>-->

	<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>

	<!-- mvn versions:display-dependency-updates -->
	<dependencyManagement>
		<dependencies>
			<!-- Note that this is upgraded in the on-jdk-9 profile below -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>2.0.7</version>
			</dependency>

			<!-- Include this globally for all tests -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>2.0.7</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.13.2</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<!-- mvn versions:display-plugin-updates -->
	<build>
		<pluginManagement>
			<plugins>

				<!--
				  Well-known core plugins used everywhere.
				-->

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${ode4j.maven-clean-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${ode4j.maven-deploy-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${ode4j.maven-install-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${ode4j.maven-resources-plugin.version}</version>
				</plugin>

				<!--
					Build helper plugin.
					http://www.mojohaus.org/build-helper-maven-plugin/index.html
				-->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${ode4j.build-helper-maven-plugin.version}</version>
				</plugin>

				<!-- TZ: I added these only to avoid warnings during release:perform-->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${ode4j.maven-javadoc-plugin.version}</version>
				</plugin>

				<!-- TZ: I added these only to avoid warnings during release:perform-->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>

				<!--
					Enforcer plugin.
					https://maven.apache.org/enforcer/maven-enforcer-plugin/
				-->

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${ode4j.maven-enforcer-plugin.version}</version>
					<executions>
						<execution>
							<id>enforce-maven</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>3.3.9</version>
									</requireMavenVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<!--
					Maven GPG plugin.
					https://maven.apache.org/plugins/maven-gpg-plugin/
				-->

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${ode4j.maven-gpg-plugin.version}</version>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
								<goal>sign</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!--
					Maven Compiler plugin.
					https://maven.apache.org/plugins/maven-compiler-plugin/
				-->

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${ode4j.maven-compiler-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>${ode4j.maven-plugin-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${ode4j.maven-surefire-plugin.version}</version>
					<configuration>
						<printSummary>true</printSummary>
						<skipTests>false</skipTests>
						<argLine>-DdDEBUG=true</argLine>
						<includes>
							<!-- include ALL tests -->
							<include>**/*.java</include>
						</includes>
						<excludes>
							<!-- exclude tests that currently fail -->
							<exclude>**/JavaMultiThreadTest.java</exclude>
						</excludes>
					</configuration>
				</plugin>

				<!--
				  Bnd Maven Plugin
				  Produces OSGi manifests

				  https://github.com/bndtools/bnd
				-->
				<plugin>
					<groupId>biz.aQute.bnd</groupId>
					<artifactId>bnd-maven-plugin</artifactId>
					<version>${ode4j.bnd-maven-plugin.version}</version>
					<configuration>
						<bnd><![CDATA[
							Bundle-DocURL: ${project.url}
							Bundle-Name: ${project.name} ${project.version} - ${project.description}
							Bundle-Description: ${project.description}
							Bundle-SCM: ${project.scm.url}
							Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
]]></bnd>
					</configuration>
				</plugin>

				<!--
				  Maven Jar plugin

				  https://maven.apache.org/plugins/maven-jar-plugin/index.html
				-->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>${ode4j.maven-jar-plugin.version}</version>
					<executions>

						<!-- Produce jar file with custom manifest -->
						<execution>
							<id>default-jar</id>
							<configuration>
								<archive>
									<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
								</archive>
							</configuration>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!-- Check compatibility with: mvn animal-sniffer:check -->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>animal-sniffer-maven-plugin</artifactId>
					<version>1.22</version>
					<configuration>
						<signature>
							<groupId>com.toasttab.android</groupId>
							<artifactId>gummy-bears-api-24</artifactId>
							<version>0.5.1</version>
						</signature>
					</configuration>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>
			<!-- Check various preconditions for building. -->
			<plugin>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>enforce-rules</id>
						<phase>validate</phase>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<!-- Require JDK 8+ -->
								<requireJavaVersion>
									<version>[1.8,)</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!--
				Set the default source level to 1.8.

				This is overridden when running on JDK 9 and above (see the
				on-jdk-9-plus profile).
			-->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<compilerArgs>
						<arg>-Xlint</arg>
					</compilerArgs>
				</configuration>
			</plugin>

			<!--
			  Produce an OSGi manifest
			-->
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>generate-osgi-manifest</id>
						<goals>
							<goal>bnd-process</goal>
						</goals>
						<phase>process-classes</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>

		<profile>
			<id>ode4j-release</id>
<!--			<modules>-->
<!--				<module>core</module>-->
<!--				<module>parent-pom</module>-->
<!--			</modules>-->
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<configuration>
									<file>${file}.jar</file>
									<keyname>${gpg.keyname}</keyname>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
		<id>on-jdk-8</id>
		<activation>
			<jdk>8</jdk>
		</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-compiler-plugin</artifactId>
						<executions>
							<execution>
							<id>default-compile</id>
							<configuration>
								<source>1.8</source>
								<target>1.8</target>
								<compilerArgs>
									<arg>-Xlint</arg>
									<arg>-Werror</arg>
								</compilerArgs>
							</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!--
			A profile activated when the building JDK is >= JDK 9.
		-->
		<profile>
			<id>on-jdk-9-plus</id>
			<activation>
				<jdk>[9, )</jdk>
			</activation>

			<!-- Upgrade SLF4J to a newer version for JDK 9 -->
<!--			<dependencyManagement>-->
<!--				<dependencies>-->
<!--					<dependency>-->
<!--						<groupId>org.slf4j</groupId>-->
<!--						<artifactId>slf4j-api</artifactId>-->
<!--						<version>2.0.7</version>-->
<!--					</dependency>-->
<!--				</dependencies>-->
<!--			</dependencyManagement>-->

			<build>
				<plugins>

					<!--
						When running on JDK 9, add src/main/java9 directories to the
						directories considered by the compiler.
					-->

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>add-source</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>${project.basedir}/src/main/java9</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!--
						Conditionally compile the available sources. First, all of
						the sources are compiled as Java 9 in order to ensure that the
						module descriptor is correct. Then, all of the sources except
						for the module descriptor are recompiled as Java 7 code.
					-->

					<plugin>
						<artifactId>maven-compiler-plugin</artifactId>
						<executions>
							<execution>
								<id>default-compile</id>
								<configuration>
									<!-- Compile everything to ensure module-info contains the
									     right entries -->
									<release>9</release>
									<source>9</source>
									<target>9</target>
								</configuration>
							</execution>

<!--							TODO TZ: WHat is this good for? Remove in 0.6.0 ....?-->
<!--							<execution>-->
<!--								<id>base-compile</id>-->
<!--								<goals>-->
<!--									<goal>compile</goal>-->
<!--								</goals>-->

<!--								&lt;!&ndash; Recompile everything for the target VM except the-->
<!--										 module-info.java &ndash;&gt;-->
<!--								<configuration>-->
<!--									<excludes>-->
<!--										<exclude>module-info.java</exclude>-->
<!--									</excludes>-->
<!--									<release>8</release>-->
<!--									<source>1.8</source>-->
<!--									<target>1.8</target>-->
<!--								</configuration>-->
<!--							</execution>-->
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
