<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>net.sf.jasperreports</groupId>
		<artifactId>jasperreports-parent</artifactId>
		<version>${revision}</version>
		<relativePath>../pom-parent.xml</relativePath>
	</parent>
	<artifactId>jasperreports-docs</artifactId>
	<packaging>pom</packaging>
	<name>JasperReports Documentation</name>
	<description>JasperReports Documentation</description>
	<url>http://jasperreports.sourceforge.net</url>
	<scm>
		<connection>${scmConnection}</connection>
		<tag>${revision}</tag>
		<url>${scmUrl}</url>
	</scm>
	<properties>
		<maven.install.skip>false</maven.install.skip>
		<maven.deploy.skip>false</maven.deploy.skip>
		<!-- set this property right here to true to enable online statistics -->
		<sf.net>false</sf.net>
	</properties>
	<build>
		<outputDirectory>${project.build.directory}/docs</outputDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>${maven-resources-plugin.version}</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/docs</outputDirectory>
							<resources>
								<resource>								
									<directory>resources</directory>
									<targetPath>resources</targetPath>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-javadoc</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/docs</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/site/apidocs</directory>
									<targetPath>api</targetPath>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.ruleoftech</groupId>
				<artifactId>markdown-page-generator-plugin</artifactId>
				<version>${maven-markdown-page-generator-plugin.version}</version>
				<executions>
					<execution>
				 	<id>convert-to-html</id>
						<phase>process-resources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<inputDirectory>${project.parent.basedir}/demo/samples</inputDirectory>
							<outputDirectory>${project.build.directory}/docs/sample.reference</outputDirectory>
							<headerHtmlFile>${project.build.directory}/docs/resources/sf-net-${sf.net}.html</headerHtmlFile>
							<footerHtmlFile>${project.build.directory}/docs/resources/footer.html</footerHtmlFile>
							<inputEncoding>UTF-8</inputEncoding>
							<outputEncoding>UTF-8</outputEncoding>
							<recursiveInput>true</recursiveInput>
							<transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
							<pegdownExtensions>TABLES,FENCED_CODE_BLOCKS,AUTOLINKS</pegdownExtensions>
						</configuration>
					</execution>
					<execution>
				 	<id>convert-root-to-html</id>
						<phase>process-resources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<inputDirectory>${project.parent.basedir}/.</inputDirectory>
							<outputDirectory>${project.build.directory}/docs</outputDirectory>
							<headerHtmlFile>${project.build.directory}/docs/resources/sf-net-${sf.net}.html</headerHtmlFile>
							<footerHtmlFile>${project.build.directory}/docs/resources/footer.html</footerHtmlFile>
							<inputEncoding>UTF-8</inputEncoding>
							<outputEncoding>UTF-8</outputEncoding>
							<recursiveInput>false</recursiveInput>
							<transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
							<pegdownExtensions>TABLES,FENCED_CODE_BLOCKS,AUTOLINKS</pegdownExtensions>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>${maven-replacer-plugin.version}</version>
				<executions>
					<execution>
						<id>replace-header</id> 
						<phase>generate-resources</phase>
						<goals> 
							<goal>replace</goal>
						</goals>
						<configuration>
							<file>${project.build.directory}/docs/resources/sf-net-${sf.net}.html</file>
							<outputFile>${project.build.directory}/docs/resources/sf-net-${sf.net}.html</outputFile>
							<regex>false</regex>
							<token>@version</token>
							<value>${revision}</value>
						</configuration>
					</execution>
					<execution>
						<id>replace-version</id> 
						<phase>process-resources</phase>
						<goals> 
							<goal>replace</goal>
						</goals>
						<configuration>
							<includes>
								<include>${project.build.directory}/docs/**/README.html</include> 
							</includes> 
							<regex>false</regex>
							<replacements>
								<replacement>
									<token>&lt;img src=&quot;../../resources/jasperreports.svg&quot; alt=&quot;JasperReports logo&quot; align=&quot;right&quot;/&gt;</token> 
									<value></value>
								</replacement>
								<replacement>
									<token>&lt;img src=&quot;../resources/jasperreports.svg&quot; alt=&quot;JasperReports logo&quot; align=&quot;right&quot;/&gt;</token>
									<value></value>
								</replacement>
								<replacement>
									<token>&lt;hr /&gt;</token>
									<value>&lt;hr size=&quot;1&quot;/&gt;</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					<execution>
						<id>replace-relative-link</id> 
						<phase>process-resources</phase>
						<goals> 
							<goal>replace</goal>
						</goals>
						<configuration>
							<file>${project.build.directory}/docs/sample.reference/README.html</file>
							<outputFile>${project.build.directory}/docs/sample.reference/README.html</outputFile>
							<regex>false</regex>
							<token>../../</token>
							<value>../</value>
						</configuration>
					</execution>
					<execution>
						<id>replace-root-links</id> 
						<phase>process-resources</phase>
						<goals> 
							<goal>replace</goal>
						</goals>
						<configuration>
							<file>${project.build.directory}/docs/README.html</file>
							<outputFile>${project.build.directory}/docs/README.html</outputFile>
							<regex>false</regex>
							<replacements>
								<replacement>
									<token>../</token> 
									<value></value>
								</replacement>
								<replacement>
									<token>https://jasperreports.sourceforge.net/</token>
									<value></value>
								</replacement>
								<replacement>
									<token>JasperReports-Ultimate-Guide-3.pdf</token>
									<value>https://jasperreports.sourceforge.net/JasperReports-Ultimate-Guide-3.pdf</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>${exec-maven-plugin.version}</version>
				<executions>
					<execution>
						<id>javadoc</id>
						<phase>generate-resources</phase>
						<goals> 
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>mvn</executable>
							<arguments>
								<argument>site</argument>
								<argument>-f</argument>
								<argument>pom-javadoc.xml</argument>
								<argument>-Denforcer.skip</argument>
								<argument>-Dmaven.buildNumber.doCheck=false</argument>
							</arguments>
							<workingDirectory>${project.basedir}</workingDirectory>
						</configuration>
					</execution>
					<execution>
						<id>config-reference</id>
						<phase>process-resources</phase>
						<goals> 
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>mvn</executable>
							<arguments>
								<argument>compile</argument>
								<argument>-Dmaven.buildNumber.doCheck=false</argument>
								<argument>-pl</argument>
								<argument>!core/pom-javaflow.xml</argument>
							</arguments>
							<workingDirectory>${project.basedir}/../</workingDirectory>
						</configuration>
					</execution>
					<execution>
						<id>functions-reference</id>
						<phase>process-resources</phase>
						<goals> 
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>mvn</executable>
							<arguments>
								<argument>compile</argument>
								<argument>exec:java</argument>
								<argument>-Denforcer.skip</argument>
								<argument>-Dmaven.buildNumber.doCheck=false</argument>
							</arguments>
							<workingDirectory>${project.basedir}/../demo/samples/functions</workingDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xml-maven-plugin</artifactId>
				<version>${xml-maven-plugin.version}</version>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals> 
							<goal>transform</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<transformationSets>
						<transformationSet>
							<dir>${basedir}</dir>
							<includes>config.reference.merge.xml</includes>
							<stylesheet>config.reference.merge.xsl</stylesheet>
							<outputDir>${project.build.directory}</outputDir>
							<fileMappers>
								<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
									<targetName>config.reference.xml</targetName>
								</fileMapper>
							</fileMappers>
							<parameters>
								<parameter>
									<name>version</name>
									<value>${revision}</value>
								</parameter>
								<parameter>
									<name>sf.net</name>
									<value>${sf.net}</value>
								</parameter>
							</parameters>							
						</transformationSet>
						<transformationSet>
							<dir>${project.build.directory}</dir>
							<includes>config.reference.xml</includes>
							<stylesheet>config.reference.xsl</stylesheet>
							<outputDir>${project.build.directory}/docs</outputDir>
							<fileMappers>
								<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
									<targetExtension>.html</targetExtension>
								</fileMapper>
							</fileMappers>
							<parameters>
								<parameter>
									<name>version</name>
									<value>${revision}</value>
								</parameter>
								<parameter>
									<name>sf.net</name>
									<value>${sf.net}</value>
								</parameter>
							</parameters>							
						</transformationSet>
						<transformationSet>
							<dir>${basedir}</dir>
							<includes>function.reference.xml</includes>
							<stylesheet>function.reference.xsl</stylesheet>
							<outputDir>${project.build.directory}/docs</outputDir>
							<fileMappers>
								<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
									<targetName>function.reference.html</targetName>
								</fileMapper>
							</fileMappers>
							<parameters>
								<parameter>
									<name>version</name>
									<value>${revision}</value>
								</parameter>
								<parameter>
									<name>sf.net</name>
									<value>${sf.net}</value>								
								</parameter>
							</parameters>							
						</transformationSet>
					</transformationSets>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>net.sf.saxon</groupId>
						<artifactId>saxon</artifactId>
						<version>8.7</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
</project>
