<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2018,2021 Contributors to the Eclipse Foundation
  ~
  ~ 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.
  -->
<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>org.eclipse.microprofile.context-propagation</groupId>
        <artifactId>microprofile-context-propagation-parent</artifactId>
        <version>1.3</version>
    </parent>

    <artifactId>microprofile-context-propagation-spec</artifactId>
    <packaging>pom</packaging>

    <name>MicroProfile Context Propagation Specification</name>
    <description>MicroProfile Context Propagation :: Specification</description>

    <properties>
        <asciidoctor-maven.version>1.5.6</asciidoctor-maven.version>
        <asciidoctorj-pdf.version>1.5.0-alpha.15</asciidoctorj-pdf.version>
        <license>Apache License v 2.0</license>
        <maven.build.timestamp.format>MMMM dd, yyyy</maven.build.timestamp.format>
        <revisiondate>${maven.build.timestamp}</revisiondate>
        <contextpropagation.spec.pdf>${project.build.directory}/generated-docs/${project.build.finalName}.pdf</contextpropagation.spec.pdf>
        <contextpropagation.spec.html>${project.build.directory}/generated-docs/${project.build.finalName}.html</contextpropagation.spec.html>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor-maven.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj-pdf.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>generate-pdf-doc</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <outputFile>${contextpropagation.spec.pdf}</outputFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>output-html</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <outputFile>${contextpropagation.spec.html}</outputFile>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <sourceDocumentName>microprofile-context-propagation.asciidoc</sourceDocumentName>
                    <sourceHighlighter>coderay</sourceHighlighter>
                    <attributes>
                        <license>Apache License v2.0</license>
                        <revnumber>${project.version}</revnumber>
                        <revremark>${revremark}</revremark>
                        <revdate>${revisiondate}</revdate>
                        <inceptionYear>${inceptionYear}</inceptionYear>
                        <currentYear>${currentYear}</currentYear>
                    </attributes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${contextpropagation.spec.pdf}</file>
                                    <type>pdf</type>
                                </artifact>
                                <artifact>
                                    <file>${contextpropagation.spec.html}</file>
                                    <type>html</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

