<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>dev.metaschema</groupId>
		<artifactId>oss-parent</artifactId>
		<version>10</version>
	</parent>

	<groupId>dev.metaschema.oscal</groupId>
	<artifactId>liboscal-java</artifactId>
	<version>7.0.0</version>
	<packaging>jar</packaging>

	<name>OSCAL Java Library</name>
	<description>A Java library that parses XML, JSON, and YAML data
		formatted acording to a Metaschema-based model.
	</description>
	<url>${site.url}</url>

	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/metaschema-framework/liboscal-java/issues</url>
	</issueManagement>

	<scm>
		<url>${scm.url}/tree/develop</url>
		<connection>scm:git:git@github.com:metaschema-framework/liboscal-java.git</connection>
		<developerConnection>scm:git:git@github.com:metaschema-framework/liboscal-java.git</developerConnection>
		<tag>v7.0.0</tag>
	</scm>

	<distributionManagement>
		<repository>
			<id>central</id>
            <name>Maven Central Repository</name>
			<url>https://central.sonatype.com</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
		</repository>
		<snapshotRepository>
			<id>repo-snapshot</id>
			<url>https://raw.githubusercontent.com/metaschema-framework/maven2/refs/heads/main</url>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</snapshotRepository>
		<site>
			<id>pages</id>
			<url>${site.url}</url>
		</site>
	</distributionManagement>
	<licenses>
		<license>
			<name>CC0-1.0</name>
			<url>https://creativecommons.org/publicdomain/zero/1.0/</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<developers>
		<developer>
			<id>david.waltermire@gsa.gov</id>
			<name>David Waltermire</name>
			<email>david.waltermire@gsa.gov</email>
			<organization>General Services Administration</organization>
			<roles>
				<role>architect</role>
				<role>developer</role>
				<role>maintainer</role>
			</roles>
		</developer>
	</developers>

	<properties>
		<!-- site configuration -->
		<site.url>https://liboscal-java.metaschema.dev</site.url>
		<scm.url>https://github.com/metaschema-framework/liboscal-java</scm.url>
		<issueManagement.url>https://github.com/metaschema-framework/liboscal-java/issues</issueManagement.url>

		<timestamp>${maven.build.timestamp}</timestamp>
		<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>

		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<maven.compiler.release>11</maven.compiler.release>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<dependency.metaschema-framework.version>3.0.0.M2</dependency.metaschema-framework.version>

		<dependency.commons-lang3.version>3.20.0</dependency.commons-lang3.version>
		<dependency.jmock-junit5.version>2.13.1</dependency.jmock-junit5.version>
		<dependency.lazy4j.version>2.0.3</dependency.lazy4j.version>
		<dependency.log4j2.version>2.25.3</dependency.log4j2.version>
		<dependency.saxon.version>12.9</dependency.saxon.version>
		<dependency.xmlunit.version>2.11.0</dependency.xmlunit.version>

		<plugin.cyclonedx.version>2.9.1</plugin.cyclonedx.version>

		<cyclonedx.schema.version>1.3</cyclonedx.schema.version>
		<oscal-content.commit>main</oscal-content.commit>

		<resources.jsonschema.path>schema/json</resources.jsonschema.path>
		<resources.xmlschema.path>schema/xml</resources.xmlschema.path>
	</properties>

	<repositories>
       <repository>
            <id>central</id>
            <name>Maven Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
		<repository>
			<id>repo-snapshot</id>
			<name>Local Snapshots</name>
			<url>https://raw.githubusercontent.com/metaschema-framework/maven2/refs/heads/main</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</repository>
	</repositories>
	<pluginRepositories>
       <pluginRepository>
            <id>central</id>
            <name>Maven Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
		<pluginRepository>
			<id>repo-snapshot</id>
			<name>Local Snapshots</name>
			<url>https://raw.githubusercontent.com/metaschema-framework/maven2/refs/heads/main</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-bom</artifactId>
				<version>${dependency.log4j2.version}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>

			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${dependency.junit5.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>dev.metaschema.java</groupId>
			<artifactId>metaschema-core</artifactId>
			<version>${dependency.metaschema-framework.version}</version>
		</dependency>

		<dependency>
			<groupId>dev.metaschema.java</groupId>
			<artifactId>metaschema-databind</artifactId>
			<version>${dependency.metaschema-framework.version}</version>
		</dependency>
		<dependency>
			<groupId>dev.metaschema.java</groupId>
			<artifactId>metaschema-schema-generator</artifactId>
			<version>${dependency.metaschema-framework.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${dependency.commons-lang3.version}</version>
		</dependency>

		<dependency>
			<groupId>com.github.spotbugs</groupId>
			<artifactId>spotbugs-annotations</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
        <dependency>
            <groupId>nl.talsmasoftware</groupId>
            <artifactId>lazy4j</artifactId>
            <version>${dependency.lazy4j.version}</version>
        </dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jmock</groupId>
			<artifactId>jmock-junit5</artifactId>
			<version>${dependency.jmock-junit5.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jmock</groupId>
			<artifactId>jmock-imposters</artifactId>
			<version>${dependency.jmock-junit5.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<version>3.27.6</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-core</artifactId>
			<version>${dependency.xmlunit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-assertj3</artifactId>
			<version>${dependency.xmlunit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.sf.saxon</groupId>
			<artifactId>Saxon-HE</artifactId>
			<version>${dependency.saxon.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-toolchains-plugin</artifactId>
					<executions>
						<execution>
							<goals>
								<goal>toolchain</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<toolchains>
							<jdk>
								<version>17</version>
								<vendor>temurin</vendor>
							</jdk>
						</toolchains>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-pmd-plugin</artifactId>
					<configuration>
						<excludeRoots>
							<excludeRoot>target/generated-sources/metaschema</excludeRoot>
						</excludeRoots>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.cyclonedx</groupId>
					<artifactId>cyclonedx-maven-plugin</artifactId>
					<version>${plugin.cyclonedx.version}</version>
					<configuration>
						<projectType>library</projectType>
						<schemaVersion>${cyclonedx.schema.version}</schemaVersion>
						<includeBomSerialNumber>true</includeBomSerialNumber>
						<includeCompileScope>true</includeCompileScope>
						<includeProvidedScope>false</includeProvidedScope>
						<includeRuntimeScope>false</includeRuntimeScope>
						<includeSystemScope>false</includeSystemScope>
						<includeTestScope>false</includeTestScope>
						<includeLicenseText>false</includeLicenseText>
						<outputFormat>all</outputFormat>
						<outputName>
							${project.artifactId}-${project.version}-cyclonedx</outputName>
					</configuration>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>makeAggregateBom</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>com.github.spotbugs</groupId>
					<artifactId>spotbugs-maven-plugin</artifactId>
					<version>${plugin.spotbugs.version}</version>
					<configuration>
						<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<configuration>
						<sourceDirectories>
							<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
							<sourceDirectory>
								${project.build.testSourceDirectory}</sourceDirectory>
						</sourceDirectories>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<configuration>
						<!-- deploy is handled by the scm plugin -->
						<skipDeploy>true</skipDeploy>
						<relativizeSiteLinks>true</relativizeSiteLinks>
						<generateReports>true</generateReports>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jxr-plugin</artifactId>
					<version>3.6.0</version>
					<configuration>
						<excludes>
							<exclude>**/module-info.java</exclude>
						</excludes>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<configuration>
						<projectVersionPolicyId>SemVerVersionPolicy</projectVersionPolicyId>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-toolchains-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>io.github.git-commit-id</groupId>
				<artifactId>git-commit-id-maven-plugin</artifactId>
				<version>9.0.2</version>
				<configuration>
					<useNativeGit>false</useNativeGit>
				</configuration>
				<executions>
					<execution>
						<id>oscal-git-info</id>
						<goals>
							<goal>revision</goal>
						</goals>
						<phase>initialize</phase>
						<configuration>
							<dotGitDirectory>${project.basedir}/oscal/.git</dotGitDirectory>
							<prefix>oscal-git</prefix>
						</configuration>
					</execution>
					<execution>
						<id>git-info</id>
						<goals>
							<goal>revision</goal>
						</goals>
						<phase>initialize</phase>
						<configuration>
							<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
							<prefix>git</prefix>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>templating-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>filter-src</id>
						<goals>
							<goal>filter-sources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.googlecode.maven-download-plugin</groupId>
				<artifactId>download-maven-plugin</artifactId>
				<version>1.13.0</version>
				<configuration>
					<skipCache>true</skipCache>
					<overwrite>false</overwrite>
				</configuration>
				<executions>
					<execution>
						<id>download-catalog-xml</id>
						<phase>test-compile</phase>
						<goals>
							<goal>wget</goal>
						</goals>
						<configuration>
							<uri>
								https://raw.githubusercontent.com/usnistgov/oscal-content/${oscal-content.commit}/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_catalog.xml</uri>
							<outputDirectory>
								${project.build.directory}/download/content</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<id>download-catalog-json</id>
						<phase>test-compile</phase>
						<goals>
							<goal>wget</goal>
						</goals>
						<configuration>
							<uri>
								https://raw.githubusercontent.com/usnistgov/oscal-content/${oscal-content.commit}/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json</uri>
							<outputDirectory>
								${project.build.directory}/download/content</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<id>download-catalog-yaml</id>
						<phase>test-compile</phase>
						<goals>
							<goal>wget</goal>
						</goals>
						<configuration>
							<uri>
								https://raw.githubusercontent.com/usnistgov/oscal-content/${oscal-content.commit}/nist.gov/SP800-53/rev5/yaml/NIST_SP-800-53_rev5_catalog.yaml</uri>
							<outputDirectory>
								${project.build.directory}/download/content</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<id>download-low-profile-xml</id>
						<phase>test-compile</phase>
						<goals>
							<goal>wget</goal>
						</goals>
						<configuration>
							<uri>
								https://raw.githubusercontent.com/usnistgov/oscal-content/${oscal-content.commit}/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline_profile.xml</uri>
							<outputDirectory>
								${project.build.directory}/download/content</outputDirectory>
						</configuration>
					</execution>
					<execution>
						<id>download-moderate-profile-json</id>
						<phase>test-compile</phase>
						<goals>
							<goal>wget</goal>
						</goals>
						<configuration>
							<uri>
								https://raw.githubusercontent.com/usnistgov/oscal-content/${oscal-content.commit}/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_MODERATE-baseline_profile.json</uri>
							<outputDirectory>
								${project.build.directory}/download/content</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>dev.metaschema.java</groupId>
				<artifactId>metaschema-maven-plugin</artifactId>
				<version>${dependency.metaschema-framework.version}</version>
				<executions>
					<execution>
						<id>oscal-codegen</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate-sources</goal>
						</goals>
						<configuration>
							<metaschemaDir>
								${project.basedir}/oscal/src/metaschema</metaschemaDir>
							<outputDirectory>${project.build.directory}/generated-sources/metaschema</outputDirectory>
							<configs>
								<config>
									${project.basedir}/src/main/metaschema-bindings/oscal-metaschema-bindings.xml</config>
							</configs>
							<includes>
								<include>oscal_complete_metaschema.xml</include>
							</includes>
							<constraints>
								<constraint>${project.basedir}/src/main/metaschema-constraints/oscal-external-constraints.xml</constraint>
							</constraints>
						</configuration>
					</execution>
					<execution>
						<id>generate-xml-schemas</id>
						<goals>
							<goal>generate-schemas</goal>
						</goals>
						<configuration>
							<metaschemaDir>
								${project.basedir}/oscal/src/metaschema</metaschemaDir>
							<outputDirectory>
								${project.build.directory}/generated-resources/oscal/schema/xml</outputDirectory>
							<includes>
								<include>oscal_*_metaschema.xml</include>
							</includes>
							<formats>
								<format>xsd</format>
							</formats>
						</configuration>
					</execution>
					<execution>
						<id>generate-json-schemas</id>
						<goals>
							<goal>generate-schemas</goal>
						</goals>
						<configuration>
							<metaschemaDir>
								${project.basedir}/oscal/src/metaschema</metaschemaDir>
							<outputDirectory>
								${project.build.directory}/generated-resources/oscal/schema/json</outputDirectory>
							<includes>
								<include>oscal_*_metaschema.xml</include>
							</includes>
							<formats>
								<format>json</format>
							</formats>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>
									${project.build.directory}/generated-sources/metaschema</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-oscal-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>
										${project.build.directory}/generated-resources/oscal</directory>
									<includes>
										<include>**/*.xsd</include>
										<include>**/*.json</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<configuration>
					<usedDependencies>
						<usedDependency>org.apache.logging.log4j:log4j-core</usedDependency>
					</usedDependencies>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				 <dependencies>
					<dependency>
						<groupId>me.fabriciorby</groupId>
						<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
						<version>1.5.1</version>
					</dependency>
				</dependencies>
				<configuration>
					<excludedEnvironmentVariables>
						<excludedEnvironmentVariable>JAVA_TOOL_OPTIONS</excludedEnvironmentVariable>
					</excludedEnvironmentVariables>
					<useModulePath>false</useModulePath>
					<redirectTestOutputToFile>true</redirectTestOutputToFile>
					<!-- Use of TCP to transmit events to the plugin -->
					<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
					<!-- Junit5 parallel configuration -->
					<parallel>all</parallel>
					<useUnlimitedThreads>true</useUnlimitedThreads>
					<properties>
						<configurationParameters>
							junit.jupiter.execution.parallel.enabled = true
							junit.jupiter.execution.parallel.mode.default = concurrent
							junit.jupiter.execution.timeout.default=60 s
						</configurationParameters>
					</properties>
					<!-- tree reporter configuration -->
					<reportFormat>plain</reportFormat>
					<consoleOutputReporter>
						<disable>true</disable>
					</consoleOutputReporter>
					<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
					</statelessTestsetInfoReporter>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<reportSets>
					<reportSet>
            			<id>default</id>
						<configuration>
							<linkJavadoc>false</linkJavadoc>
						</configuration>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<profiles>
		<profile>
			<id>gpg</id>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-gpg-plugin</artifactId>
							<executions>
								<execution>
									<id>sign-artifacts</id>
									<phase>verify</phase>
									<goals>
										<goal>sign</goal>
									</goals>
									<configuration>
										<!-- enable, since the default is skip -->
										<skip>false</skip>
										<gpgArguments>
											<arg>--pinentry-mode</arg>
											<arg>loopback</arg>
										</gpgArguments>
									</configuration>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.cyclonedx</groupId>
						<artifactId>cyclonedx-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deployment</id>
			<build>
				<plugins>
					<plugin>
			          <groupId>org.sonatype.central</groupId>
			          <artifactId>central-publishing-maven-plugin</artifactId>
			          <version>0.10.0</version>
			          <extensions>true</extensions>
			          <configuration>
			             <publishingServerId>central</publishingServerId>
			             <autoPublish>false</autoPublish>
			          </configuration>
			        </plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>snapshots</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
