<?xml version="1.0" encoding="UTF-8"?>
<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>org.unix4j</groupId>
		<artifactId>unix4j-core</artifactId>
		<version>0.4</version>
	</parent>

	<artifactId>unix4j-command</artifactId>

	<build>
		<plugins>
			<!-- Freemarker maven plugin for code generation -->
			<plugin>
				<groupId>com.googlecode.fmpp-maven-plugin</groupId>
				<artifactId>fmpp-maven-plugin</artifactId>
				<version>1.0</version>
				<dependencies>
					<dependency>
						<groupId>org.unix4j</groupId>
						<artifactId>unix4j-tools</artifactId>
						<version>${project.parent.version}</version>
						<optional>true</optional>
					</dependency>
				</dependencies>
				<configuration>
					<cfgFile>src/main/resources/codegen/config.fmpp</cfgFile>
					<outputDirectory>target/generated-sources/main</outputDirectory>
					<templateDirectory>src/main/resources/codegen/templates</templateDirectory>
				</configuration>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>target/generated-sources/main</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											com.googlecode.fmpp-maven-plugin
										</groupId>
										<artifactId>
											fmpp-maven-plugin
										</artifactId>
										<versionRange>
											[1.0,)
										</versionRange>
										<goals>
											<goal>generate</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<dependencies>
		<!-- <dependency> <groupId>org.unix4j</groupId> <artifactId>unix4j-tools</artifactId>
			<version>0.1-SNAPSHOT</version> <optional>true</optional> </dependency> -->
		<dependency>
			<groupId>org.unix4j</groupId>
			<artifactId>unix4j-base</artifactId>
			<version>${project.parent.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>jdk16</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
		</profile>
		<profile>
			<id>jdk17</id>
			<activation>
				<jdk>1.7</jdk>
			</activation>
		</profile>
	</profiles>
</project>
