<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>io.ecocode</groupId>
	<artifactId>ecocode-rules-specifications</artifactId>
	<version>0.0.1</version>

	<name>ecoCode Rules Specifications repository</name>
	<description>Repository that contains the specifications of every static-analysis rules available in ecoCode plugins.</description>
	<url>https://github.com/green-code-initiative/ecoCode/tree/main/ecocode-rules-specifications</url>
	<organization>
		<name>green-code-initiative</name>
		<url>https://github.com/green-code-initiative</url>
	</organization>
	<licenses>
		<license>
			<name>GPL v3</name>
			<url>https://www.gnu.org/licenses/gpl-3.0.en.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<!--
            Mandatory information to be able to publish to Maven Central:
            https://central.sonatype.org/publish/requirements/#developer-information
        -->
		<developer>
			<name>Gilles Grousset</name>
			<email>zippy1978@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>Maxime Malgorn</name>
			<email>utarwyn@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>Geoffrey Lalloué</name>
			<email>glalloue@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>David DE CARVALHO</name>
			<email>dedece35@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>Olivier Le Goaër</name>
			<email>olegoaer@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>Julien Hertout</name>
			<email>jhertout@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>Jules Delecour</name>
			<email>jules-delecour-dav@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
		<developer>
			<name>DUBOIS Maxime</name>
			<email>mdubois81@users.noreply.github.com</email>
			<organization>green-code-initiative</organization>
			<organizationUrl>https://github.com/green-code-initiative</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://github.com/green-code-initiative/ecocode/ecocode-rules-specifications</connection>
		<developerConnection>scm:git:https://github.com/green-code-initiative/ecocode/ecocode-rules-specifications</developerConnection>
		<url>https://github.com/green-code-initiative/ecocode/ecocode-rules-specifications</url>
	</scm>
	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/green-code-initiative/ecocode/issues</url>
	</issueManagement>
	<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>

	<properties>
		<encoding>UTF-8</encoding>
		<java.version>11</java.version>
		<maven.compiler.release>11</maven.compiler.release>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.13</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>injected-nexus-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin><!--
					This plugin convert ASCIIDOC rule specification in HTML format
					ASCIIDOC format is used with custom features such as :
					- syntax highlighting (see code blocks on ASCIIDOC rules)
					- inclusions (see: php/EC74.asciidoc)
					- table data generation from CSV (see: php/EC34.asciidoc)

					NB: Current version has a bug which display following false positive warning :
					[WARNING] Duplicated destination found: overwriting file ...

					This issue is fixed in 3.x release of asciidoctor-maven-plugin
				-->
				<groupId>org.asciidoctor</groupId>
				<artifactId>asciidoctor-maven-plugin</artifactId>
				<version>2.2.4</version>
				<executions>
					<execution>
						<id>convert-to-html</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process-asciidoc</goal>
						</goals>
						<configuration>
							<sourceDirectory>${project.basedir}/src/main/rules</sourceDirectory>
							<outputDirectory>${project.build.directory}/rules-html</outputDirectory>
							<attributes>
								<source-highlighter>coderay</source-highlighter>
								<coderay-css>style</coderay-css>
							</attributes>
							<preserveDirectories>true</preserveDirectories>
							<embedAssets>true</embedAssets>
							<headerFooter>false</headerFooter>
							<relativeBaseDir>true</relativeBaseDir>
							<logHandler>
								<failIf>
									<severity>ERROR</severity>
								</failIf>
							</logHandler>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin><!--
					Prepare resources tree needed by language.
					Each metadata JSON file must be in the same folder as the HTML description file for the corresponding language.
				-->
				<groupId>org.codehaus.gmaven</groupId>
				<artifactId>groovy-maven-plugin</artifactId>
				<version>2.1.1</version>
				<executions>
					<execution>
						<phase>generate-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<source>${project.basedir}/src/main/script/prepare-resources.groovy</source>
							<properties>
								<sourceDir>${project.build.directory}/rules-html</sourceDir>
								<targetDir>${project.build.outputDirectory}/io/ecocode/rules</targetDir>
							</properties>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin><!--
					This module produce one artifact by language (with corresponding classifier)
					For example, to add rule specifications for Python language, add following dependency in python sonarqube plugin:

			        <dependency>
			            <groupId>io.ecocode</groupId>
			            <artifactId>ecocode-rules-specifications</artifactId>
			            <version>${project.version}</version>
			            <classifier>python</classifier>
			        </dependency>
				-->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.6.0</version>
				<executions>
					<execution>
						<id>assembly-java</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>${project.basedir}/src/main/assembly/java.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<execution>
						<id>assembly-php</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>${project.basedir}/src/main/assembly/php.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<execution>
						<id>assembly-python</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>${project.basedir}/src/main/assembly/python.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<execution>
						<id>assembly-javascript</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>${project.basedir}/src/main/assembly/javascript.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<appendAssemblyId>true</appendAssemblyId>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
