<?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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <artifactId>cdi-tck-reference-guide</artifactId>
    <packaging>jdocbook</packaging>
    <name>CDI TCK Reference Guide</name>

    <parent>
        <groupId>org.jboss.cdi.tck</groupId>
        <artifactId>cdi-tck-parent</artifactId>
        <version>2.0.0.Alpha2</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>


    <properties>
        <asciidoctor.version>0.1.4</asciidoctor.version>
        <pdf.name>cdi-tck-reference-guide.pdf</pdf.name>
        <jdocbook.source.directory>target/docbook</jdocbook.source.directory>
    </properties>

    <build>
        <defaultGoal>clean process-classes</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.version}</version>
                <executions>
                    <execution>
                        <id>output-docbook</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>docbook45</backend>
                            <doctype>book</doctype>
                            <toc>true</toc>
                            <sourceDocumentName>cdi-tck-reference-guide.asciidoc</sourceDocumentName>
                            <templateEngine>slim</templateEngine>
                            <headerFooter>true</headerFooter>
                            <compact>false</compact>
                            <outputDirectory>${jdocbook.source.directory}/en-US</outputDirectory>
                            <attributes>
                                <docinfo>true</docinfo>
                                <experimental>true</experimental>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jboss.maven.plugins</groupId>
                <artifactId>maven-jdocbook-plugin</artifactId>
                <configuration>
                    <sourceDirectory>${basedir}/${jdocbook.source.directory}</sourceDirectory>
                    <sourceDocumentName>cdi-tck-reference-guide.xml</sourceDocumentName>
                    <masterTranslation>en-US</masterTranslation>
                    <imageResource>
                        <directory>${project.basedir}/src/main/asciidoc</directory>
                        <includes>
                            <include>images/*.png</include>
                        </includes>
                    </imageResource>
                    <options>
                        <injectionDateFormat>dd/MM/yyyy</injectionDateFormat>
                    </options>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-zip</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.outputDirectory}/${project.artifactId}-${project.version}.war</file>
                                    <type>war</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <configuration>
                            <tasks>
                                <copy file="${basedir}/target/docbook/publish/en-US/pdf/${pdf.name}" todir="${basedir}" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jboss-plugin-public-repository</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>jboss-repo</id>
                    <url>https://repository.jboss.org/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>jboss-public-repository-group</id>
                    <name>JBoss Public Maven Repository Group</name>
                    <url>http://repository.jboss.org/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                        <updatePolicy>never</updatePolicy>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <scm>
        <connection>scm:git:git://github.com/cdi-spec/cditck.git</connection>
        <developerConnection>scm:git:git@github.com:cdi-spec/cdi-tck.git</developerConnection>
        <url>https://github.com/cdi-spec/cdi-tck/</url>
      <tag>2.0.0.Alpha2</tag>
  </scm>
</project>
