<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2020 Immutables Authors and Contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
<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>

	<groupId>io.immutables</groupId>
	<artifactId>parent</artifactId>
	<version>0.0.5</version>
	<packaging>pom</packaging>

	<name>${project.groupId}.${project.artifactId}</name>
	<description>Immutables IO collection of libraries</description>
	<url>http://immutables.io</url>

	<modules>
    <module>io/codec</module>
    <module>io/common</module>
    <module>io/ecs/gen</module>
    <module>io/ecs/lib</module>
    <module>io/grammar</module>
    <module>io/micro</module>
    <module>io/micro/tester</module>
    <module>io/net</module>
    <module>io/regres</module>
    <module>io/stream</module>
    <module>io/that</module>
	</modules>

	<organization>
		<name>Immutables</name>
		<url>http://immutables.io</url>
	</organization>

	<developers>
		<developer>
			<id>elucash</id>
			<name>Eugene Lukash</name>
			<email>e.lucash@gmail.com</email>
			<timezone>-5</timezone>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
			<comments>For all published artifacts and runtime dependencies unless otherwise noted</comments>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:https://github.com/immutables/io.git</connection>
		<developerConnection>scm:git:git@github.com:immutables/io.git</developerConnection>
		<url>https://github.com/immutables/io.git</url>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<module.name>${project.groupId}.${project.artifactId}</module.name>
		<maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
	</properties>

	<repositories>
		<repository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<distributionManagement>
		<snapshotRepository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>sonatype-nexus-staging</id>
			<name>Nexus Release Repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<testSourceDirectory>test</testSourceDirectory>
		<resources>
			<resource>
				<directory>src</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>res</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>test</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</testResource>
			<testResource>
				<directory>test-res</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</testResource>
		</testResources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>

				<executions>
					<execution>
						<id>default-jar</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<archive>
								<addMavenDescriptor>false</addMavenDescriptor>
								<manifestEntries>
									<Automatic-Module-Name>${module.name}</Automatic-Module-Name>
								</manifestEntries>
							</archive>
						</configuration>
					</execution>
					<execution>
						<id>test-jar</id>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
					<execution>
						<id>empty-javadoc-jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<classifier>javadoc</classifier>
							<classesDirectory>${basedir}/target/classes</classesDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<annotationProcessors>
					</annotationProcessors>
					<useIncrementalCompilation>false</useIncrementalCompilation>
					<compilerArgs>
						<arg>-Xlint:unchecked</arg>
						<arg>-proc:none</arg>
						<arg>-Xmaxerrs</arg>
						<arg>1000000</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<!-- This plugin isn't strictly necessary; without it the generated
				sources are compiled just fine. It's here to make importing the project
				into Eclipse using M2Eclipse a much smoother process. Thanks to this
				configuration users won't have to manually add each generated source
				directory to the build path. -->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>add-source</id>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src-gen</source>
								<source>src-gen1</source>
								<source>src-gen2</source>
								<source>src-gen3</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>test-gen</source>
								<source>test-gen1</source>
								<source>test-gen2</source>
								<source>test-gen3</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.1</version>
					<configuration>
						<mavenExecutorId>forked-path</mavenExecutorId>
						<useReleaseProfile>false</useReleaseProfile>
						<arguments>-Psonatype-oss-release</arguments>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>sonatype-oss-release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
