<?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.8.1</version>
	</parent>

	<artifactId>metaschema-java-codegen</artifactId>

	<name>Metaschema Java Code Generator</name>
	<description>A Metaschema binding-based parser for Java objects supporting serialization of conformant XML, JSON, and YAML data.</description>

	<url>${site.url}${project.artifactId}/</url>
	<distributionManagement>
		<site>
			<id>nist-pages</id>
			<url>${site.url}${project.artifactId}/</url>
		</site>
	</distributionManagement>

	<dependencies>
		<dependency>
			<groupId>${project.parent.groupId}</groupId>
			<artifactId>metaschema-model-common</artifactId>
		</dependency>
		<dependency>
			<groupId>${project.parent.groupId}</groupId>
			<artifactId>metaschema-model</artifactId>
		</dependency>
		<dependency>
			<groupId>${project.parent.groupId}</groupId>
			<artifactId>metaschema-java-binding</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>com.squareup</groupId>
			<artifactId>javapoet</artifactId>
			<version>1.13.0</version>
		</dependency>
		<!-- Used to generate Java class, field, package, etc. names -->
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jetbrains</groupId>
			<artifactId>annotations</artifactId>
		</dependency>

		<dependency>
			<groupId>net.openhft</groupId>
			<artifactId>compiler</artifactId>
			<version>2.21ea82</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jmock</groupId>
			<artifactId>jmock-junit5</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<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-pmd-plugin</artifactId>
					<configuration>
						<excludeRoots>
							<excludeRoot>target/generated-sources/xmlbeans</excludeRoot>
						</excludeRoots>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<configuration>
						<excludePackageNames>gov.nist.secauto.metaschema.codegen.xmlbeans,org.apache.xmlbeans.metadata.*</excludePackageNames>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.xmlbeans</groupId>
				<artifactId>xmlbeans</artifactId>
				<executions>
					<execution>
						<id>metaschema-codegen</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<sourceDir>${project.basedir}/src/main/xsd</sourceDir>
							<javaTargetDir>${project.build.directory}/generated-sources/xmlbeans</javaTargetDir>
							<classTargetDir>${project.basedir}/target/generated-resources/xmlbeans</classTargetDir>
							<xmlConfigs>${project.basedir}/src/main/xsdconfig/metaschema-binding.xsdconfig</xmlConfigs>
							<name>metaschema.codegen</name>
							<partialMethods>ALL,-XGET,-XSET,-XGET_ARRAY,-XSET_ARRAY,-XGET_IDX,-XSET_IDX</partialMethods>
							<!-- <repackage>gov.nist.secauto.metaschema.codegen.xmlbeans</repackage> -->
						</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/xmlbeans</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>
</project>