<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>systems.uom</groupId>
		<artifactId>systems-parent</artifactId>
		<version>2.1</version>
	</parent>
	<artifactId>systems-ucum</artifactId>
	<name>Units of Measurement UCUM System</name>
	<description>Unit System supporting the Unified Code for Units of Measure (UCUM)</description>
	<licenses>
		<license>
			<name>BSD 3-Clause</name>
			<url>LICENSE</url>
		</license>
		<license>
			<name>UCUM</name>
			<url>http://unitsofmeasure.org/trac/wiki/TermsOfUse</url>
		</license>
	</licenses>
	<contributors>
	   <contributor>
            <name>Magno N. A. Cruz</name>
            <organization>GlobalMentor, Inc.</organization>
            <organizationUrl>http://www.globalmentor.com/</organizationUrl>
        </contributor>
        <contributor>
            <name>See contributors.txt</name>
        </contributor>
	</contributors>
	
	<!-- ======================================================= -->
	<!-- Build Settings -->
	<!-- ======================================================= -->
	<properties>
		<jdkVersion>8</jdkVersion>
		<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
		<maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
		<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
		<jdkOptionalVersion>9</jdkOptionalVersion>
		<!-- The oldest Java version supported by this tool. -->
		<!-- Will control compilation of the main code and the unit tests. -->
		<base.java.version>8</base.java.version>
	</properties>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>javax.measure</groupId>
				<artifactId>unit-api</artifactId>
				<version>${jsr.version}</version>
			</dependency>
			<dependency>
				<groupId>tech.units</groupId>
				<artifactId>indriya</artifactId>
				<version>${ri.version}</version>
			</dependency>
			<dependency>
				<groupId>systems.uom</groupId>
				<artifactId>systems-quantity</artifactId>
				<version>${quantity.version}</version>
			</dependency>
			<dependency>
				<groupId>systems.uom</groupId>
				<artifactId>systems-common</artifactId>
				<version>${project.version}</version>
			</dependency>
		</dependencies>		
	</dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>tech.units</groupId>
			<artifactId>indriya</artifactId>
		</dependency>
		<dependency>
			<groupId>si.uom</groupId>
			<artifactId>si-quantity</artifactId>
		</dependency>
		<dependency>
			<groupId>si.uom</groupId>
			<artifactId>si-units</artifactId>
		</dependency>
		<dependency>
			<groupId>systems.uom</groupId>
			<artifactId>systems-quantity</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
		  <groupId>jakarta.inject</groupId>
		  <artifactId>jakarta.inject-api</artifactId>
		  <version>2.0.0</version>
		</dependency>
		
		<!-- Testing -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-runner</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>		
			<!-- Use toolchains to select the compilers -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-toolchains-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<goals>
							<goal>toolchain</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<toolchains>
						<jdk>
							<version>[8,)</version>
						</jdk>
					</toolchains>
				</configuration>
			</plugin>

			<!-- define the possible compilations -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${base.java.version}</source>
					<target>${base.java.version}</target>
				</configuration>
				<executions>
					<!-- for Java 9 -->
					<execution>
						<id>java9</id>
						<phase/>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<release>9</release>
							<jdkToolchain>
								<version>9</version>
							</jdkToolchain>
							<compileSourceRoots>
								<compileSourceRoot>${project.basedir}/src/main/jdk9</compileSourceRoot>
							</compileSourceRoots>
							<multiReleaseOutput>true</multiReleaseOutput>
						</configuration>
					</execution>
				</executions>
			</plugin>
		
			<!-- JAR packaging -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Specification-Title>Unit API</Specification-Title>
							<Specification-Version>${jsr.version}</Specification-Version>
							<Specification-Vendor>Unit-API contributors</Specification-Vendor>
							<Implementation-Title>${project.name}</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
							<Implementation-URL>http://www.uom.systems</Implementation-URL>
							<Automatic-Module-Name>systems.uom.ucum</Automatic-Module-Name>
							<Multi-Release>true</Multi-Release>
						</manifestEntries>
					</archive>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		
			<!-- ======================================================= -->
			<!-- Source Attachment -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>

			<!-- ======================================================= -->
			<!-- JavaDoc Attachment -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<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-toolchains-plugin
										</artifactId>
										<versionRange>
											[3.0.0,)
										</versionRange>
										<goals>
											<goal>toolchain</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	
	<profiles>
		<!-- enable java9 compilation -->
		<profile>
			<id>compile-java9</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<executions>
							<execution>
								<id>java9</id>
								<phase>compile</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>