<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>
	<groupId>tech.units</groupId>
	<artifactId>unit-tck</artifactId>
	<packaging>bundle</packaging>
	<name>Units of Measurement TCK</name>
	<url>https://unitsofmeasurement.github.io/unit-tck/</url>
	<organization>
		<name>Units of Measurement project</name>
		<url>http://unitsofmeasurement.github.io</url>
	</organization>
	<description>Units of Measurement (JSR 385) TCK</description>
	<parent>
		<groupId>tech.uom</groupId>
		<artifactId>uom-parent</artifactId>
		<version>2.2</version>
	</parent>
	<licenses>
		<license>
			<name>BSD3</name>
			<url>LICENSE</url>
		</license>
	</licenses>
	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/unitsofmeasurement/unit-tck/issues</url>
	</issueManagement>
	<scm>
		<url>https://github.com/unitsofmeasurement/unit-tck.git</url>
	</scm>

	<!-- ======================================================= -->
	<!-- Build Settings -->
	<!-- ======================================================= -->
	<properties>
		<jsr.version>2.2</jsr.version>
		<ri.version>2.2</ri.version>
		<lib.version>2.2</lib.version>
		<jdkVersion>9</jdkVersion>
		<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
		<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
		<testng.version>7.8.0</testng.version>
		<jakarta.inject.version>2.0.1</jakarta.inject.version>
		<jboss.test.audit.version>2.0.0.Final</jboss.test.audit.version>
		<hamcrest.version>2.2</hamcrest.version>
		<reflections.version>0.10.2</reflections.version>
		<maven.enforcer.version>3.4.1</maven.enforcer.version>
		<maven.exec.version>3.1.0</maven.exec.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>tech.units</groupId>
				<artifactId>indriya</artifactId>
				<version>${ri.version}</version>
				<scope>test</scope>
				<type>jar</type>
			</dependency>
			<dependency>
				<groupId>tech.uom.lib</groupId>
				<artifactId>uom-lib-common</artifactId>
				<version>${lib.version}</version>
			</dependency>

            <dependency>
                <groupId>jakarta.inject</groupId>
                <artifactId>jakarta.inject-api</artifactId>
                <version>${jakarta.inject.version}</version>
            </dependency>
			<dependency>
				<groupId>org.testng</groupId>
				<artifactId>testng</artifactId>
				<version>${testng.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest-library</artifactId>
				<version>${hamcrest.version}</version>
			</dependency>
			<dependency>
				<groupId>org.reflections</groupId>
				<artifactId>reflections</artifactId>
				<version>${reflections.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>javax.measure</groupId>
			<artifactId>unit-api</artifactId>
		</dependency>
		<dependency>
			<groupId>tech.units</groupId>
			<artifactId>indriya</artifactId>
			<scope>test</scope>
			<type>jar</type>
			<exclusions>
        		<exclusion>
          			<groupId>org.apiguardian</groupId>
            		<artifactId>apiguardian-api</artifactId>
        		</exclusion>
      		</exclusions>
		</dependency>
		<dependency>
			<groupId>tech.uom.lib</groupId>
			<artifactId>uom-lib-common</artifactId>
		</dependency>

         <dependency>
             <groupId>jakarta.inject</groupId>
             <artifactId>jakarta.inject-api</artifactId>
         </dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
		</dependency>
		<dependency>
			<groupId>org.reflections</groupId>
			<artifactId>reflections</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jboss.test-audit</groupId>
			<artifactId>jboss-test-audit-api</artifactId>
			<version>${jboss.test.audit.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jboss.test-audit</groupId>
			<artifactId>jboss-test-audit-impl</artifactId>
			<version>${jboss.test.audit.version}</version>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
		   <plugins>
		           <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, Otavio Santana</owner>
	                        <currentYear>2023</currentYear>
	                    </properties>
	                    <excludes>
	                    	<exclude>.editorconfig</exclude>
							<exclude>.gitattributes</exclude>
							<exclude>.circleci/**</exclude>
	                        <exclude>**/pom.xml</exclude>
	                        <exclude>**/README</exclude>
	                        <exclude>**/settings.xml</exclude>
							<exclude>docs/**</exclude>
	                        <exclude>src/test/resources/**</exclude>
	                        <exclude>src/main/resources/**</exclude>
	                        <exclude>src/etc/**</exclude>
	                        <exclude>src/main/config/**</exclude>
	                    </excludes>
	                    <headerDefinitions>
	                        <headerDefinition>src/main/config/headers.xml</headerDefinition>
	                    </headerDefinitions>
	                    <mapping>
	                        <java>JAVA_STYLE</java>
	                    </mapping>
	                </configuration>
	            </plugin>
	            
	            <plugin>
				  <groupId>org.apache.maven.plugins</groupId>
				  <artifactId>maven-enforcer-plugin</artifactId>
				  <version>${maven.enforcer.version}</version>
				</plugin>	            
	        </plugins>
		</pluginManagement>
		<plugins>
			<!-- ======================================================= -->
			<!-- Compilation -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<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 -->
							<release>${jdkVersion}</release>
							<source>${jdkVersion}</source>
							<target>${jdkVersion}</target>
							<argLine>
    							--add-exports org.jboss.test.audit.annotations/org.jboss.test.audit.config=ALL-UNNAMED 
    							--add-opens tech.units.tck=ALL-UNNAMED
							</argLine>					
						</configuration>
					</execution>
					<execution>
						<id>base-compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<!-- recompile everything for target VM except the module-info.java -->
						<configuration>
							<release>8</release>
							<source>8</source>
							<target>8</target>
							<excludes>
								<exclude>module-info.java</exclude>
							</excludes>
						</configuration>
					</execution>
					<execution>
				      <id>default-testCompile</id>
				      <phase>process-test-sources</phase>
				      <goals>
				        <goal>testCompile</goal>
				      </goals>
				      <configuration>
				        <release>${jdkVersion}</release>
				        <source>${jdkVersion}</source>
				        <target>${jdkVersion}</target>
				      </configuration>
				    </execution>
				</executions>				
			</plugin>

			<!-- ======================================================= -->
			<!-- JAR packaging -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<mainClass>tech.units.tck.TCKRunner</mainClass>
						</manifest>
						<manifestEntries>
							<Specification-Title>Units of Measurement API</Specification-Title>
							<Specification-Version>${jsr.version}</Specification-Version>
							<Specification-Vendor>Unit-API contributors</Specification-Vendor>
							<Implementation-Title>Units of Measurement TCK</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
							<Implementation-URL>${project.organization.url}</Implementation-URL>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>${maven.exec.version}</version>
				<configuration>
					<executable>java</executable>
					<mainClass>tech.units.tck.TCKRunner</mainClass>
				</configuration>
			</plugin>

			<!-- ======================================================= -->
			<!-- Packaging (OSGi bundle) -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>tech.units.tck.*</Export-Package>
						<!-- <Private-Package>tech.units.tck.internal.*</Private-Package> -->
					</instructions>
				</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>

			<!-- ======================================================= -->
			<!-- Maven web site -->
			<!-- ======================================================= -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<configuration>
					<locales>en</locales>
					<inputEncoding>${project.build.sourceEncoding}</inputEncoding>
					<outputEncoding>UTF-8</outputEncoding>
					<reportPlugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-project-info-reports-plugin</artifactId>
							<version>2.7</version>
							<reportSets>
								<reportSet>
									<reports>
										<report>index</report>
										<report>summary</report>
										<report>license</report>
										<report>scm</report>
										<report>cim</report>
										<report>project-team</report>
										<report>mailing-list</report>
										<report>issue-tracking</report>
									</reports>
								</reportSet>
							</reportSets>
						</plugin>

						<!-- ======================================================= -->
						<!-- Javadoc generation -->
						<!-- -->
						<!-- Do not set <docfilessubdirs> to true, since this -->
						<!-- cause the unwanted copy of .svn sub-directories. -->
						<!-- ======================================================= -->
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-javadoc-plugin</artifactId>
							<version>${maven.javadoc.version}</version>
							<configuration>
								<source>${project.build.javaVersion}</source>             <!-- Enables javadoc to handle assertions present in J2SE 1.4. -->
								<encoding>${project.build.sourceEncoding}</encoding>       <!-- The encoding of the source files. -->
								<docencoding>${project.build.sourceEncoding}</docencoding> <!-- The encoding of the generated HTML files. -->
								<charset>${sourceEncoding}</charset>         <!-- Specifies the HTML character set for this document. -->
								<locale>en</locale>              <!-- Locale that javadoc uses when generating documentation. -->
								<noqualifier>all</noqualifier>   <!-- Omit qualifying package name before class names in output. -->
								<quiet>true</quiet>              <!-- Shuts off non-error and non-warning messages. -->
								<keywords>true</keywords>        <!-- Adds HTML meta keyword tags to the generated files. -->
								<!-- Creates links to existing javadoc-generated documentation of
									external referenced classes. -->
								<links>
									<link>http://docs.oracle.com/javase/7/docs/api/</link>
								</links>
							</configuration>
						</plugin>

						<!-- ======================================================= -->
						<!-- Code analysis -->
						<!-- ======================================================= -->
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-pmd-plugin</artifactId>
							<version>3.0.1</version>
							<configuration>
								<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
								<targetJdk>${project.build.javaVersion}</targetJdk>
							</configuration>
						</plugin>

						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-surefire-plugin</artifactId>
						</plugin>
						
						<plugin>
						  <groupId>org.apache.maven.plugins</groupId>
						  <artifactId>maven-enforcer-plugin</artifactId>
						  <executions>
						    <execution>
						      <id>enforce</id>
						      <configuration>
						        <rules>
						          <dependencyConvergence/>
						        </rules>
						      </configuration>
						      <goals>
						        <goal>enforce</goal>
						      </goals>
						    </execution>
						  </executions>
						</plugin>

						<!-- ======================================================= -->
						<!-- Report on test results -->
						<!-- ======================================================= -->
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-surefire-report-plugin</artifactId>
							<version>2.16</version>
						</plugin>

						<!-- ======================================================= -->
						<!-- Report on test coverage -->
						<!-- ======================================================= -->
						<plugin>
							<groupId>org.codehaus.mojo</groupId>
							<artifactId>emma-maven-plugin</artifactId>
							<version>1.0-alpha-3</version>
							<reportSets>
								<reportSet></reportSet>
								<reportSet></reportSet>
							</reportSets>
						</plugin>
					</reportPlugins>
				</configuration>
			</plugin>
		</plugins>
	</build>

    <!-- 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>
             <repository>
            <id>repository.jboss.org</id>
            <name>JBoss Repository</name>
            <url>http://repository.jboss.org/maven2</url>
        </repository>
        <repository>
            <id>jboss-maven2-brew</id>
            <name>JBoss Maven 2 Brew Repository</name>
            <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>jboss-maven2-snapshots</id>
            <name>JBoss Maven 2 Brew Repository</name>
            <url>https://repository.jboss.org/nexus/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>version</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>${maven.exec.version}</version>
						<configuration>
							<executable>java</executable>
							<mainClass>tech.units.tck.TCKRunner</mainClass>
							<arguments>
								<argument>-version</argument>
							</arguments>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
