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

    <parent>
        <groupId>org.springframework.rewrite</groupId>
        <artifactId>spring-rewrite-commons</artifactId>
        <version>0.1.0-SNAPSHOT</version>
    </parent>

    <artifactId>spring-rewrite-commons-docs</artifactId>

    <name>Docs</name>
    <description>Spring Rewrite Commons documentation</description>

    <build>
        <plugins>
            <plugin>
                <groupId>io.spring.maven.antora</groupId>
                <artifactId>antora-maven-plugin</artifactId>
                <version>${io.spring.maven.antora-version}</version>
                <extensions>true</extensions>
                <configuration>
                    <playbook>src/main/antora/antora-playbook.yml</playbook>
                    <packages>
                        <package>@antora/atlas-extension@1.0.0-alpha.1</package>
                        <package>@antora/collector-extension@1.0.0-alpha.3</package>
                        <package>@asciidoctor/tabs@1.0.0-beta.3</package>
                        <package>@springio/antora-extensions@1.5.0</package>
                        <package>@springio/asciidoctor-extensions@1.0.0-alpha.9</package>
                        <package>@djencks/asciidoctor-mathjax@0.0.9</package>
                    </packages>
                </configuration>
            </plugin>
            <plugin>
                <groupId>io.spring.maven.antora</groupId>
                <artifactId>antora-component-version-maven-plugin</artifactId>
                <version>${io.spring.maven.antora-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>antora-component-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj-pdf.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-epub3</artifactId>
                        <version>${asciidoctorj-epub.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.spring.asciidoctor.backends</groupId>
                        <artifactId>spring-asciidoctor-backends</artifactId>
                        <version>${spring-asciidoctor-backends.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectory>${project.basedir}/src/main/asciidoc</sourceDirectory>
                    <outputDirectory>${project.build.directory}/asciidoc</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-html</id>
                        <phase>site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>spring-html</backend>
                            <doctype>book</doctype>
                            <attributes>
                                <docinfodir>${project.build.directory}/asciidoc</docinfodir>
                                <docinfo>shared</docinfo>
                                <stylesdir>css/</stylesdir>
                                <stylesheet>site.css</stylesheet>
                                <linkcss>true</linkcss>
                                <icons>font</icons>
                                <sectanchors />
                                <source-highlighter>highlight.js</source-highlighter>
                                <highlightjsdir>js/highlight</highlightjsdir>
                                <highlightjs-theme>github</highlightjs-theme>
                                <idprefix />
                                <idseparator>-</idseparator>
                                <project-name>${project.name}</project-name>
                                <projectVersion>${project.version}</projectVersion>
                                <spring-version>${project.version}</spring-version>
                                <revnumber>${project.version}</revnumber>
                                <allow-uri-read />
                            </attributes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-pdf</id>
                        <phase>site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <doctype>book</doctype>
                            <attributes>
                                <icons>font</icons>
                                <pagenums />
                                <sectnums />
                                <sectanchors />
                                <toc />
                                <source-highlighter>coderay</source-highlighter>
                                <project-version>${project.version}</project-version>
                                <revnumber>${project.version}</revnumber>
                            </attributes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-epub</id>
                        <phase>site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>epub3</backend>
                            <doctype>book</doctype>
                            <attributes>
                                <icons>font</icons>
                                <pagenums />
                                <sectnums />
                                <sectanchors />
                                <toc />
                                <source-highlighter>coderay</source-highlighter>
                                <project-version>${project.version}</project-version>
                                <revnumber>${project.version}</revnumber>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly-plugin.version}</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/docs.xml</descriptor>
                    </descriptors>
                    <finalName> ${project.artifactId}-${project.version}</finalName>
                    <appendAssemblyId>true</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>create-distribution</id>
                        <phase>site</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>