<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>tech.uom</groupId>
		<artifactId>uom-parent</artifactId>
		<version>2.2.3</version>
	</parent>
	<groupId>si.uom</groupId>
	<artifactId>si-parent</artifactId>
	<packaging>pom</packaging>
	<name>International System of Units (SI)</name>
	<description>Units of Measurement SI (Système International d'Unités)</description>	    
	<version>2.2.2</version>
	<organization>
		<name>Units of Measurement</name>
	</organization>
		
	<!-- ======================================================= -->
	<!-- Build Settings -->
	<!-- ======================================================= -->
	<properties>
		<!-- Versions -->
		<jdkVersion>1.8</jdkVersion>
		<jsr.version>2.2</jsr.version>
		<lib.version>2.2</lib.version>
		<ri.version>2.2.3</ri.version>
		<si.version>${project.version}</si.version><!-- -->
		<si.quantity.version>2.2.2</si.quantity.version><!-- To handle quantity 
			separately, makes deployment easier -->
		<jakarta.annotation.version>2.0.0</jakarta.annotation.version>
		<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
		<maven.compile.targetLevel>1.8</maven.compile.targetLevel>
		<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
		<thisYear>2025</thisYear>
		<bnd.version>7.0.0</bnd.version>
		<build-helper.version>3.6.0</build-helper.version>
		<maven.surefire.version>3.5.3</maven.surefire.version>
	</properties>
	<modules>
		<module>quantity</module>
		<module>units</module>
	</modules>

	<build>
		<pluginManagement>
			<plugins>
				<!-- ======================================================= -->
				<!-- Compilation -->
				<!-- ======================================================= -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>${project.build.javaVersion}</source>
						<target>${project.build.javaVersion}</target>
						<encoding>${project.build.sourceEncoding}</encoding>
					</configuration>
				</plugin>

				<!-- ======================================================= -->
				<!-- OSGi bundles with BND -->
				<!-- ======================================================= -->
				<plugin>
					<groupId>biz.aQute.bnd</groupId>
					<artifactId>bnd-maven-plugin</artifactId>
					<version>${bnd.version}</version>
					<executions>
						<execution>
							<goals>
								<goal>bnd-process</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${build-helper.version}</version>
				</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>International System of Units</Specification-Title>
								<Specification-Version>${project.version}</Specification-Version>
								<Specification-Vendor>${project.organization.name}</Specification-Vendor>
								<Implementation-Vendor>Units of Measurement contributors</Implementation-Vendor>
								<Implementation-URL>${project.organization.url}</Implementation-URL>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>

				<!-- ======================================================= -->
				<!-- JavaDoc Attachment -->
				<!-- ======================================================= -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<detectLinks>true</detectLinks>
						<keywords>true</keywords>
						<linksource>true</linksource>
						<failOnError>false</failOnError>
						<source>${maven.compile.sourceLevel}</source>
						<verbose>true</verbose>
					</configuration>
				</plugin>

				<!-- ======================================================= -->
				<!-- Maven License Plugin -->
				<!-- ======================================================= -->
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<configuration>
						<header>src/main/config/header.txt</header>
						<properties>
							<owner>Jean-Marie Dautelle, Werner Keil and others</owner>
							<currentYear>${thisYear}</currentYear>
						</properties>
						<excludes>
							<exclude>**/README</exclude>
							<exclude>**/pom.xml</exclude>
							<exclude>docs/**</exclude>
							<exclude>**/settings.xml</exclude>
							<exclude>src/test/resources/**</exclude>
							<exclude>src/main/resources/**</exclude>
							<exclude>src/main/config/**</exclude>
							<exclude>src/etc/**</exclude>
							<exclude>*.css</exclude>
							<exclude>*.editorconfig</exclude>
							<exclude>*.jpg</exclude>
							<exclude>*.png</exclude>
							<exclude>*.yml</exclude>
						</excludes>
						<headerDefinitions>
							<headerDefinition>src/main/config/headers.xml</headerDefinition>
						</headerDefinitions>
						<mapping>
							<java>JAVA_STYLE</java>
						</mapping>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<!-- Dependency Management -->
	<dependencyManagement>
		<dependencies>
			<!-- OSGI support -->
			<dependency>
				<groupId>org.osgi</groupId>
				<artifactId>org.osgi.annotation</artifactId>
				<scope>provided</scope>
				<optional>true</optional>
			</dependency>
			<dependency>
				<groupId>org.osgi</groupId>
				<artifactId>org.osgi.compendium</artifactId>
				<scope>provided</scope>
				<optional>true</optional>
			</dependency>
			<dependency>
				<groupId>org.osgi</groupId>
				<artifactId>org.osgi.core</artifactId>
				<scope>provided</scope>
				<optional>true</optional>
			</dependency>
			
			<dependency>
				<groupId>jakarta.annotation</groupId>
				<artifactId>jakarta.annotation-api</artifactId>
				<version>${jakarta.annotation.version}</version>
			</dependency>
			
			<!-- Testing -->
			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest-junit</artifactId>
				<version>${hamcrest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${junit.jupiter.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-params</artifactId>
				<version>${junit.jupiter.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${junit.jupiter.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-launcher</artifactId>
				<version>${junit.platform.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-runner</artifactId>
				<version>${junit.platform.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

    <!-- Additional repositories -->
    <!-- Helps to resolve Parent POM and Snapshot artifacts -->
    <repositories>
        <repository>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>ossrh-snapshot</id>
            <name>OSSRH Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>       
    </repositories>

    <!-- Deployment to public servers -->
    <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>
    
	<profiles>
		<profile>
			<id>p2</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.reficio</groupId>
						<artifactId>p2-maven-plugin</artifactId>
						<version>1.2.0</version>
						<executions>
							<execution>
								<id>default-cli</id>
								<configuration>
									<artifacts>
										<!-- specify your depencies here -->
										<!-- groupId:artifactId:version -->
										<artifact>
											<id>javax.measure:unit-api:${jsr.version}</id>
										</artifact>
										<artifact>
											<id>tech.uom.lib:uom-lib-common:${lib.version}</id>
										</artifact>
										<artifact>
											<id>tech.units:indriya:${ri.version}</id>
										</artifact>
										<artifact>
											<id>si.uom:si-quantity:${si.quantity.version}</id>
										</artifact>
									</artifacts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>

			<pluginRepositories>
				<pluginRepository>
					<id>reficio</id>
					<url>http://repo.reficio.org/maven/</url>
				</pluginRepository>
			</pluginRepositories>
		</profile>

		<profile>
			<id>jdk9-setup</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-compiler-plugin</artifactId>
							<configuration>
								<release>8</release>
							</configuration>
							<executions>
								<execution>
									<id>default-compile</id>
									<configuration>
										<release>9</release>
										<source>9</source>
										<target>9</target>
									</configuration>
								</execution>
								<execution>
									<id>base-compile</id>
									<goals>
										<goal>compile</goal>
									</goals>
									<configuration>
										<excludes>
											<exclude>module-info.java</exclude>
										</excludes>
									</configuration>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>add-jdk9-source</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>src/main/jdk9</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
					  <groupId>org.apache.maven.plugins</groupId>
					  <artifactId>maven-surefire-plugin</artifactId>
					  <configuration>
					    <forkCount>3</forkCount>
					    <reuseForks>true</reuseForks>
					    <argLine>-Xmx4g -XX:MaxPermSize=256m</argLine>
					  </configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
