<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.semanticweb.rulewerk</groupId>
		<artifactId>rulewerk-parent</artifactId>
		<version>0.9.0</version>
	</parent>

	<artifactId>rulewerk-parser</artifactId>

	<name>Rulewerk Parser</name>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>rulewerk-core</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>ruleparser</id>
						<configuration>
							<sourceDirectory>${basedir}/src/main/java/org/semanticweb/rulewerk/parser/javacc/</sourceDirectory>
						</configuration>
						<goals>
							<goal>javacc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- add the generated sources to the project, so the
					 LSP server will find the code. -->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<configuration>
							<sources>
								<source>${project.build.directory}/generated-sources/javacc/</source>
							</sources>
						</configuration>
						<goals>
							<goal>add-source</goal>
						</goals>
					</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>org.codehaus.mojo</groupId>
										<artifactId>javacc-maven-plugin</artifactId>
										<versionRange>[2.6,)</versionRange>
										<goals>
											<goal>javacc</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>build-helper-maven-plugin</artifactId>
										<versionRange>[1.0,)</versionRange>
										<goals>
											<goal>parse-version</goal>
											<goal>add-source</goal>
											<goal>maven-version</goal>
											<goal>add-resource</goal>
											<goal>add-test-resource</goal>
											<goal>add-test-source</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnConfiguration>true</runOnConfiguration>
											<runOnIncremental>true</runOnIncremental>
										</execute>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>
