<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2012, 2021 International Business Machines Corp.

   See the NOTICE file distributed with this work for additional information
   regarding copyright ownership. 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.

   SPDX-License-Identifier: Apache-2.0
 -->
<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>

    <parent>
        <groupId>jakarta.batch</groupId>
        <artifactId>batch-api-parent</artifactId>
        <version>2.1.0-M2</version>
    </parent>

    <groupId>jakarta.batch</groupId>
    <artifactId>specification</artifactId>
    <packaging>pom</packaging>

    <name>Jakarta Batch Specification</name>
    <description>Specification document module</description>

    <properties>
        <site.output.dir>${project.build.directory}/staging</site.output.dir>
        <maven.site.skip>true</maven.site.skip>
        <asciidoctor.maven.plugin.version>1.5.7.1</asciidoctor.maven.plugin.version>
        <asciidoctorj.version>1.6.2</asciidoctorj.version>
        <asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>
        <jruby.version>9.2.6.0</jruby.version>
        <!-- status: DRAFT, BETA, etc., or blank for final -->
        <status>DRAFT</status>
        <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
        <revisiondate>${maven.build.timestamp}</revisiondate>

        <!-- Assuming not necessarily identical to Maven project version -->
        <spec.version>2.1</spec.version>
    </properties>

    <build>
        <defaultGoal>package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj</artifactId>
                        <version>${asciidoctorj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj.pdf.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>asciidoc-to-html</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <outputFile>${project.build.directory}/generated-docs/jakarta-batch-spec-${spec.version}.html</outputFile>
                            <attributes>
                                <doctype>book</doctype>
                                <status>${status}</status>
                                <data-uri />
                                <icons>font</icons>
                                <toc>left</toc>
                                <icons>font</icons>
                                <sectanchors>true</sectanchors>
                                <idprefix />
                                <idseparator>-</idseparator>
                                <docinfo1>true</docinfo1>
                            </attributes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>asciidoc-to-pdf</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <outputFile>${project.build.directory}/generated-docs/jakarta-batch-spec-${spec.version}.pdf</outputFile>
                            <attributes>
                                <pdf-stylesdir>${project.basedir}/src/theme</pdf-stylesdir>
                                <pdf-style>jakartaee</pdf-style>
                                <doctype>book</doctype>
                                <status>${status}</status>
                                <data-uri />
                                <icons>font</icons>
                                <pagenums />
                                <toc />
                                <icons>font</icons>
                                <sectanchors>true</sectanchors>
                                <idprefix />
                                <idseparator>-</idseparator>
                                <docinfo1>true</docinfo1>
                                <embedAssets>true</embedAssets>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <sourceDocumentName>jakarta-batch-spec.adoc</sourceDocumentName>
                    <sourceHighlighter>coderay</sourceHighlighter>
                    <attributes>
                        <revnumber>${spec.version}</revnumber>
                        <revremark>${status}</revremark>
                        <revdate>${revisiondate}</revdate>
                    </attributes>
                    <skip>${maven.adoc.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>${release.arguments}</arguments>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.4</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
                This is the rule that builds the zip file for download.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${version.org.apache.maven.plugins.maven-assembly-plugin}</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                            <skipAssembly>${maven.adoc.skip}</skipAssembly>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
