<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>net.open-esb</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.2</version>
    </parent>

    <groupId>net.open-esb.admin</groupId>
    <artifactId>openesb-oeadmin</artifactId>
    <version>1.0.2</version>
    <packaging>jar</packaging>

    <name>OpenESB Administration Tools - oeadmin</name>
    
    <description>
        Use the oeadmin utility to perform administrative tasks for OpenESB
        instance from the command line or from a script. You can use this 
        utility instead of the Console interface.
    </description>
    
    <scm>
        <url>git@bitbucket.org:openesb/openesb-oeadmin.git</url>
        <connection>scm:git:git@bitbucket.org:openesb/openesb-oeadmin.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:openesb/openesb-oeadmin.git</developerConnection>
    </scm>
    
    <properties>
        <asciidoctor.version>1.5.0</asciidoctor.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Main-Class>net.openesb.command.CommandCli</Main-Class>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <activation>
                <property>
                    <name>docs</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>${asciidoctor.version}</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>output-single-html</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                                <configuration>
                                    <backend>html5</backend>
                                    <doctype>book</doctype>
                                    <outputDirectory>${project.build.directory}/generated-docs/${project.version}/reference/htmlsingle/</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>output-docbook</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                                <configuration>
                                    <backend>docbook</backend>
                                    <doctype>book</doctype>
                                    <outputDirectory>${project.build.directory}/generated-docs/${project.version}/reference/docbook/</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceDirectory>src/asciidoc</sourceDirectory>
                            <headerFooter>true</headerFooter>
                            <sourceHighlighter>prettify</sourceHighlighter>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <version>1.35</version>
        </dependency>
        <dependency>
            <groupId>net.open-esb.admin</groupId>
            <artifactId>openesb-java-sdk</artifactId>
            <version>1.0.2</version>
        </dependency>
    </dependencies>
</project>
