<?xml version="1.0"?>
<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>gov.nist.secauto.metaschema</groupId>
		<artifactId>metaschema-framework</artifactId>
		<version>0.4.0</version>
	</parent>

	<artifactId>metaschema-model</artifactId>

	<name>Metaschema Model</name>
	<url>https://pages.nist.gov/metaschema</url>

	<scm>
		<url>https://github.com/usnistgov/metaschema-java/tree/main/metaschema-model</url>
	  <tag>v0.4.0</tag>
  </scm>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>metaschema-java-datatypes</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.xmlbeans</groupId>
			<artifactId>xmlbeans</artifactId>
		</dependency>
		<dependency>
			<groupId>xml-resolver</groupId>
			<artifactId>xml-resolver</artifactId>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-jul</artifactId>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-pmd-plugin</artifactId>
					<configuration>
						<excludeRoots>
							<excludeRoot>${project.build.directory}/generated-sources/xmlbeans</excludeRoot>
						</excludeRoots>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<configuration>
						<excludePackageNames>gov.nist.itl.metaschema.model.m4.xml:gov.nist.itl.metaschema.model.m4.xml.impl</excludePackageNames>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/schema/xsd</outputDirectory>
							<resources>
								<resource>
									<directory>../metaschema/toolchains/xslt-M4/validate</directory>
									<includes>
										<include>metaschema.xsd</include>
									</includes>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xmlbeans-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>metaschema-M4</id>
						<goals>
							<goal>xmlbeans</goal>
						</goals>
						<configuration>
							<schemaDirectory>${project.build.directory}/schema/xsd</schemaDirectory>
							<sourceGenerationDirectory>${project.build.directory}/generated-sources/xmlbeans</sourceGenerationDirectory>
							<xmlConfigs>
								<xmlConfig implementation="java.io.File">${project.basedir}/src/main/xsdconfig/metaschema-M4.xsdconfig</xmlConfig>
							</xmlConfigs>
							<staleFile>${project.build.directory}/generated-sources/xmlbeans-M4/.staleFlag</staleFile>
						</configuration>
					</execution>
				</executions>
				<!-- <dependencies> -->
				<!-- <dependency> -->
				<!-- <groupId>org.apache.xmlbeans</groupId> -->
				<!-- <artifactId>xmlbeans</artifactId> -->
				<!-- <version>${dependency.xmlbeans.version}</version> -->
				<!-- </dependency> -->
				<!-- </dependencies> -->
			</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>
		</plugins>
	</build>
</project>
