<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.janusproject.sre</groupId>
		<artifactId>io.janusproject</artifactId>
		<version>0.12.0</version>
	</parent>

	<groupId>io.janusproject</groupId>
	<artifactId>io.janusproject.network</artifactId>
	<packaging>eclipse-plugin</packaging>
	<name>Janus Project Network extension</name>
	<url>${janusUrl}</url>
	<inceptionYear>2020</inceptionYear>

	<properties>
		<jkernel.version>2.${project.version}</jkernel.version>
		<cliRunnerMainClass>io.sarl.sre.boot.Boot</cliRunnerMainClass>
		<bootstrap>io.sarl.sre.boot.SreMain</bootstrap>
	</properties>

	<build>
		<plugins>
			<!-- CAUTION:
					The following plugin is copying the service definitions from META-INF/services
					into the target/classes/META-INF/services because the "eclipse-plugin"
					reactor does not copy these files in this particular location.
					But, it is mandatory in order to enable debugging into the Eclipse DSL tool.
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-bootique-module-providers</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}/META-INF/services</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/META-INF/services</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
							<overwrite>true</overwrite>
						</configuration>
					</execution>
				</executions>
			</plugin>			
			<plugin>
				<groupId>io.sarl.maven</groupId>
				<artifactId>sarl-maven-plugin</artifactId>
				<!-- Maven extension mechanism seems not working because the plugin is 
					defined in the same project. The different goals must be explicitly provided. -->
				<executions>
					<execution>
						<id>sarl-compiler-init</id>
						<phase>initialize</phase>
						<goals>
							<goal>initialize</goal>
						</goals>
					</execution>
					<execution>
						<id>sarl-compiler-compile</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>sarl-compiler-clean</id>
						<phase>clean</phase>
						<goals>
							<goal>clean</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<tycho>true</tycho>
					<source>${sarl-dsl.min.jdk.version}</source>
					<target>${sarl-dsl.min.jdk.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
					<generateInlines>true</generateInlines>
					<generateStorageFiles>true</generateStorageFiles>
					<generateTraceFiles>true</generateTraceFiles>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<sourceDirectories>
						<sourceDirectory>src/main/sarl</sourceDirectory>
					</sourceDirectories>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-source-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>
