<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.1</version>
    </parent>
    <artifactId>uom-lib-jackson</artifactId>
    <name>Units of Measurement Jackson Library</name>
    <description>Contains custom serializers and deserializers for JSR 385</description>
    <organization>
        <name>Units of Measurement project</name>
        <url>https://unitsofmeasurement.github.io</url>
    </organization>
    <licenses>
        <license>
            <name>BSD</name>
            <url>LICENSE</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>keilw</id>
            <name>Werner Keil</name>
            <email>werner@catmedia.us</email>
            <organization>Creative Arts &amp; Technologies</organization>
            <organizationUrl>http://www.catmedia.us</organizationUrl>
            <roles>
                <role>Architect</role>
                <role>Java Developer</role>
                <role>Spec Lead</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <!-- ======================================================= -->
    <!-- Build Settings -->
    <!-- ======================================================= -->
    <properties>
        <project.build.javaVersion>1.8</project.build.javaVersion>
        <jdkVersion>1.8</jdkVersion>
        <maven.compile.targetLevel>1.8</maven.compile.targetLevel>
        <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
        <ri.version>2.1.2</ri.version>
        <ucum.version>2.1</ucum.version>
        <jackson.version>2.11.2</jackson.version>
        <compile.exclude.files>module-info.java</compile.exclude.files>
    </properties>
    <dependencies>
        <!-- =========================================================================================================== -->
        <!-- The units of measurement interface is in the javax.measure package. -->
        <!-- The implementation is provided by the JSR 385 RI -->
        <!-- =========================================================================================================== -->
        <dependency>
            <groupId>javax.measure</groupId>
            <artifactId>unit-api</artifactId>
        </dependency>
        <dependency>
            <groupId>tech.units</groupId>
            <artifactId>indriya</artifactId>
        </dependency>
        <dependency>
            <groupId>systems.uom</groupId>
            <artifactId>systems-quantity</artifactId>
            <version>${ucum.version}</version>
        </dependency>
        <dependency>
            <groupId>systems.uom</groupId>
            <artifactId>systems-ucum</artifactId>
            <version>${ucum.version}</version>
        </dependency>

        <!-- =========================================================================================================== -->
        <!-- Jackson library for JSON-parsing -->
        <!-- =========================================================================================================== -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdkVersion}</source>
                    <target>${jdkVersion}</target>
                </configuration>
            </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>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <configuration>
                    <bnd>-exportcontents: tech.uom.lib.jackson.*</bnd>
                </configuration>
            </plugin>
            
            <!-- ======================================================= -->
            <!-- JAR -->
            <!-- ======================================================= -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </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.jacoco</groupId>
                                        <artifactId>
                                            jacoco-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.7.0.201403182114,)
                                        </versionRange>
                                        <goals>
                                            <goal>prepare-agent</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    
    <!-- TODO could be removed later after switch to 2.1.1 -->
    <!-- Additional repositories -->
    <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>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <name>OSSRH</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
           <id>ossrh</id>
           <name>OSSRH Snapshot</name>
           <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>       
</project>