<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.lib</groupId>
		<artifactId>uom-lib</artifactId>
		<version>2.0</version>
	</parent>
	<artifactId>uom-lib-common</artifactId>
	<name>Units of Measurement Common Library</name>
	<packaging>bundle</packaging>
	<properties>
		<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
	</properties>
	<dependencies>
		<dependency>
			<groupId>javax.measure</groupId>
			<artifactId>unit-api</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
				<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>9</source>
					<target>9</target>
				</configuration>
				<executions>
					<execution>
						<id>default-compile</id>
						<configuration>
							<!-- compile everything to ensure module-info contains right entries -->
							<!-- required when JAVA_HOME is JDK 8 or below -->
							<jdkToolchain>
								<version>9</version>
							</jdkToolchain>
							<release>9</release>
						</configuration>
					</execution>
					<execution>
						<id>base-compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<!-- recompile everything for target VM except the module-info.java -->
						<configuration>
							<source>${maven.compile.sourceLevel}</source>
							<target>${maven.compile.targetLevel}</target>
							<excludes>
								<exclude>tech/uom/lib/common/module-info.java</exclude>
							</excludes>
						</configuration>
					</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>
				<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>

			<!-- ======================================================= -->
			<!-- Packaging (OSGi bundle) -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>tech.uom.lib.common.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>