<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>io.inkstand</groupId>
		<artifactId>halite</artifactId>
		<version>0.1.1</version>
	</parent>

	<artifactId>halite-core</artifactId>
	<name>${project.groupId}:${project.artifactId}</name>
	<description>Base classes implementing the HAL specification.</description>

	<dependencies>
		<dependency>
			<groupId>xmlunit</groupId>
			<artifactId>xmlunit</artifactId>
			<version>1.5</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
	<pluginManagement>
			<plugins>
				<!-- If we e.g. execute on JDK 1.7, we should compile for Java 7 to get the same (or higher) JAXB API version as used 
					during the xjc execution. -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.7</source>
						<target>1.7</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>jaxb2-maven-plugin</artifactId>
										<versionRange>[1.6,)</versionRange>
										<goals>
											<goal>schemagen</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>

			</plugins>

		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jaxb2-maven-plugin</artifactId>
				<version>1.6</version>
				<executions>
					<execution>
						<id>schemagen</id>
						<goals>
							<goal>schemagen</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<transformSchemas>
						<transformSchema>
							<uri>http://inkstand.io/halite</uri>
							<toPrefix>hal</toPrefix>
							<toFile>io.inkstand.halite.v1.xsd</toFile>
						</transformSchema>
					</transformSchemas>
					<includes>
						<include>**/*.java</include>
					</includes>
					<outputDirectory>${project.build.directory}/generated-resources/schemas</outputDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/generated-resources/schemas</directory>
									<includes>
										<include>**/*.xsd</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
