<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>com.foldright.auto-pipeline</groupId>
	<artifactId>auto-pipeline-parent</artifactId>
	<version>0.2.0</version>
	<packaging>pom</packaging>
	<name>${project.artifactId}</name>
	<url>https://github.com/foldright/auto-pipeline</url>
	<description>auto-pipeline is a source code generator that auto generate the component's pipeline.</description>
	<inceptionYear>2021</inceptionYear>

	<modules>
		<module>auto-pipeline-annotations</module>
		<module>auto-pipeline-processor</module>
		<module>auto-pipeline-examples</module>
	</modules>

	<licenses>
		<license>
			<name>Apache 2</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
			<comments>A business-friendly OSS license</comments>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:git@github.com:foldright/auto-pipeline.git</connection>
		<developerConnection>scm:git:git@github.com:foldright/auto-pipeline.git</developerConnection>
		<url>https://github.com/foldright/auto-pipeline</url>
	</scm>
	<developers>
		<developer>
			<name>XuZebin</name>
			<id>zavakid</id>
			<email>zava.kid(AT)gmail(DOT)com</email>
			<roles>
				<role>Developer</role>
			</roles>
			<timezone>+8</timezone>
		</developer>
		<developer>
			<name>Jerry Lee</name>
			<id>oldratlee</id>
			<email>oldratlee(AT)gmail(DOT)com</email>
			<roles>
				<role>Developer</role>
			</roles>
			<timezone>+8</timezone>
			<url>https://github.com/oldratlee</url>
		</developer>
	</developers>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<slf4j.version>1.7.36</slf4j.version>
		<log4j2.version>2.17.2</log4j2.version>
		<netty.version>4.1.75.Final</netty.version>

		<kotlin.version>1.6.10</kotlin.version>
		<!-- https://kotlinlang.org/docs/maven.html#specifying-compiler-options -->
		<kotlin.compiler.apiVersion>1.5</kotlin.compiler.apiVersion>
		<kotlin.compiler.jvmTarget>${maven.compiler.source}</kotlin.compiler.jvmTarget>
		<dokka.version>1.6.10</dokka.version>
		<dokka.link.jdk.version>8</dokka.link.jdk.version>

		<!-- testing dependencies versions -->
		<junit5.version>5.8.2</junit5.version>
		<kotest.version>5.2.1</kotest.version>
		<assertj.version>3.22.0</assertj.version>
	</properties>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<!--
		common dependencies for all projects
	-->
	<dependencies>
		<!-- logging libs -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<scope>test</scope>
		</dependency>
		<!-- QA libs -->
		<dependency>
			<groupId>com.github.spotbugs</groupId>
			<artifactId>spotbugs-annotations</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
		<!-- testing libs -->
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-runner-junit5-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-assertions-core-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-property-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-bom</artifactId>
				<version>${kotlin.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${junit5.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>io.netty</groupId>
				<artifactId>netty-bom</artifactId>
				<version>${netty.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!-- logging libs -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-bom</artifactId>
				<version>${log4j2.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!-- common libs -->
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>31.1-jre</version>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>3.12.0</version>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-text</artifactId>
				<version>1.9</version>
			</dependency>

			<!--
				source processing/compiler/template libs
			-->
			<dependency>
				<groupId>com.squareup</groupId>
				<artifactId>javapoet</artifactId>
				<version>1.13.0</version>
			</dependency>
			<dependency>
				<groupId>org.freemarker</groupId>
				<artifactId>freemarker</artifactId>
				<version>2.3.31</version>
			</dependency>
			<!-- https://github.com/tschuchortdev/kotlin-compile-testing -->
			<dependency>
				<groupId>com.github.tschuchortdev</groupId>
				<artifactId>kotlin-compile-testing</artifactId>
				<version>1.4.7</version>
				<scope>test</scope>
			</dependency>

			<!--
				inject and config libs
			-->
			<dependency>
				<groupId>javax.inject</groupId>
				<artifactId>javax.inject</artifactId>
				<version>1</version>
			</dependency>
			<dependency>
				<groupId>com.google.inject</groupId>
				<artifactId>guice</artifactId>
				<version>5.1.0</version>
			</dependency>
			<dependency>
				<groupId>com.typesafe</groupId>
				<artifactId>config</artifactId>
				<version>1.4.2</version>
			</dependency>

			<!--
				QA libs
			-->
			<!--
				JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
				Please continue using findbugs’ one.
				depend on spotbugs-annotations instead.
				https://spotbugs.readthedocs.io/en/stable/migration.html
			-->
			<dependency>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-annotations</artifactId>
				<version>4.6.0</version>
				<scope>provided</scope>
				<optional>true</optional>
			</dependency>
			<!--
				testing libs
			-->
			<!-- https://github.com/kotlintest/kotlintest -->
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-runner-junit5-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-assertions-core-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-property-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<!-- https://github.com/joel-costigliola/assertj-core -->
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-core</artifactId>
				<version>${assertj.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/main/java</sourceDir>
							</sourceDirs>
						</configuration>
					</execution>
					<execution>
						<id>test-compile</id>
						<goals>
							<goal>test-compile</goal>
						</goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/test/java</sourceDir>
							</sourceDirs>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!--
					https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html

					configuration by pom properties element:
						- source: maven.compiler.source
						- target: maven.compiler.target
						- encoding: project.build.sourceEncoding
						- release: maven.compiler.release
				-->
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<!-- Replacing default-compile as it is treated specially by maven -->
					<execution>
						<id>default-compile</id>
						<phase>none</phase>
					</execution>
					<!-- Replacing default-testCompile as it is treated specially by maven -->
					<execution>
						<id>default-testCompile</id>
						<phase>none</phase>
					</execution>
					<execution>
						<id>java-compile</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>java-test-compile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<extensions>true</extensions>
				<!-- In multi-module builds using the deploy-at-end feature,
					 the deployment of all components is performed in the last module based on the reactor order.
					 If this property is set to true in the last module,
					 all staging deployment for all modules will be skipped.
					 so, we'll config nexus deploy after every moudle's deploy phase
				-->
				<!-- see: https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin#configuring-the-plugin -->
				<executions>
					<execution>
						<id>default-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<!--
					config example: https://github.com/mojohaus/versions-maven-plugin/issues/157#issuecomment-306041074
				-->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<configuration>
					<!--
						$maven.multiModuleProjectDirectory
						Finding the root directory of a multi module maven reactor project - Stack Overflow
						https://stackoverflow.com/questions/3084629
					-->
					<rulesUri>
						file://${maven.multiModuleProjectDirectory}/auto-pipeline-processor/src/versions-rules.xml
					</rulesUri>
					<generateBackupPoms>false</generateBackupPoms>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.10.1</version>
				</plugin>
				<plugin>
					<groupId>org.jetbrains.kotlin</groupId>
					<artifactId>kotlin-maven-plugin</artifactId>
					<version>${kotlin.version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.3.2</version>
				</plugin>
				<plugin>
					<groupId>org.jetbrains.dokka</groupId>
					<artifactId>dokka-maven-plugin</artifactId>
					<version>${dokka.version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>versions-maven-plugin</artifactId>
					<version>2.10.0</version>
				</plugin>
				<plugin>
					<groupId>pl.project13.maven</groupId>
					<artifactId>git-commit-id-plugin</artifactId>
					<version>4.9.10</version>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.12</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>add-release-javac-option-for-jdk9+</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<properties>
				<maven.compiler.release>8</maven.compiler.release>
			</properties>
		</profile>
		<profile>
			<id>gen-src</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-doc</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<source>8</source>
							<show>protected</show>
							<charset>UTF-8</charset>
							<encoding>UTF-8</encoding>
							<docencoding>UTF-8</docencoding>
							<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html -->
							<excludePackageNames>*.internal.*</excludePackageNames>
							<overview>src/api/overview.html</overview>
							<additionalJOptions>
								<additionalJOption>-quiet</additionalJOption>
								<additionalJOption>-J-Duser.language=en</additionalJOption>
								<additionalJOption>-J-Duser.country=US</additionalJOption>
							</additionalJOptions>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-sign</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-git-properties</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						Maven plugin which includes build-time git repository information into an POJO / *.properties).
						Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
							https://github.com/ktoso/maven-git-commit-id-plugin
					-->
					<plugin>
						<groupId>pl.project13.maven</groupId>
						<artifactId>git-commit-id-plugin</artifactId>
						<executions>
							<execution>
								<id>get-the-git-infos</id>
								<goals>
									<goal>revision</goal>
								</goals>
							</execution>
							<execution>
								<id>validate-the-git-infos</id>
								<goals>
									<goal>validateRevision</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<validationProperties>
								<!-- verify that the current repository is not dirty -->
								<validationProperty>
									<name>validating git dirty</name>
									<!--suppress MavenModelInspection -->
									<value>${git.dirty}</value>
									<shouldMatchTo>false</shouldMatchTo>
								</validationProperty>
							</validationProperties>
							<generateGitPropertiesFile>true</generateGitPropertiesFile>
							<generateGitPropertiesFilename>
								${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties
							</generateGitPropertiesFilename>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>enforcer+when-release</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html

						add maven-enforce-plugin to make sure the right jdk is used
						https://stackoverflow.com/a/18420462/922688
					-->
					<plugin>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>enforce-jdk-versions</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireJavaVersion>
											<version>${maven.compiler.source}</version>
										</requireJavaVersion>
										<requireMavenVersion>
											<version>3.5.0</version>
										</requireMavenVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
