<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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctorj</artifactId>
    <version>1.5.0</version>
    <packaging>jar</packaging>

    <name>AsciidoctorJ</name>
    <description>AsciidoctorJ provides Java bindings for the Asciidoctor RubyGem using JRuby</description>
    <url>https://github.com/asciidoctor/asciidoctorj</url>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/asciidoctor/asciidoctorj/issues</url>
    </issueManagement>
    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:asciidoctor/asciidoctorj.git</connection>
        <developerConnection>scm:git:git@github.com:asciidoctor/asciidoctorj.git</developerConnection>
        <url>scm:git:git@github.com:asciidoctor/asciidoctorj.git</url>
    </scm>

    <developers>
        <developer>
            <id>asotobu</id>
            <name>Alex Soto Bueno</name>
            <email>asotobu@gmail.com</email>
            <roles>
                <role>Lead Developer</role>
            </roles>
            <timezone>1</timezone>
        </developer>
        <developer>
            <id>mojavelinux</id>
            <name>Dan Allen</name>
            <email>dan.j.allen@gmail.com</email>
            <roles>
                <role>Contributor</role>
            </roles>
            <timezone>-7</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.scriptSourceDirectory>src/main/scripts/</project.build.scriptSourceDirectory>
        <project.buildDirectory>src/main/build</project.buildDirectory>
        <jruby.version>1.7.9</jruby.version>
        <junit.version>4.11</junit.version>
        <jsoup.version>1.7.3</jsoup.version>
        <xmlmatchers.version>1.0-RC1</xmlmatchers.version>
        <hamcrest.version>1.3</hamcrest.version>
        <guava.version>15.0</guava.version>
        <haml.version>4.0.4</haml.version>
        <tilt.version>2.0.0</tilt.version>
        <coderay.version>1.1.0</coderay.version>
        <cacheUri.version>0.0.5</cacheUri.version>
        <threadsafe.version>0.3.4</threadsafe.version>
        <asciidoctor.epub3.version>1.0.0.alpha.3</asciidoctor.epub3.version>
        <asciidoctor.version>1.5.0</asciidoctor.version>
        <erubis.version>2.7.0</erubis.version>
        <slim.version>2.0.2</slim.version>
        <jcommander.version>1.32</jcommander.version>
        <gem.home.directory>classes</gem.home.directory>
        <slf4.version>1.7.5</slf4.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>${jruby.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlmatchers</groupId>
            <artifactId>xml-matchers</artifactId>
            <version>${xmlmatchers.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>net.sf.saxon</groupId>
                    <artifactId>Saxon-HE</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Use newer version of Saxon than provided by xmlunit
             The older version causes problems when using Xpath in Nokogiri -->
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>9.5.1-6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>${jsoup.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>thread_safe</artifactId>
            <version>${threadsafe.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>haml</artifactId>
            <version>${haml.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>open-uri-cached</artifactId>
            <version>${cacheUri.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>asciidoctor</artifactId>
            <version>${asciidoctor.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>coderay</artifactId>
            <version>${coderay.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>asciidoctor-epub3</artifactId>
            <version>${asciidoctor.epub3.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>tilt</artifactId>
            <version>${tilt.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>erubis</artifactId>
            <version>${erubis.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>slim</artifactId>
            <version>${slim.version}</version>
            <type>gem</type>
            <scope>provided</scope>
        </dependency>

        <!-- Dependencies for running AJI as standalone application -->
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <version>${jcommander.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>

            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.1</version>
              <configuration>
                <source>1.6</source>
                <target>1.6</target>
              </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.asciidoctor.cli.AsciidoctorInvoker</mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>libs</classpathPrefix>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <compilation>${maven.build.timestamp}</compilation>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <skip>false</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>unit-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <!-- <skip>false</skip> -->
                            <includes>
                                <!--
                                <include>**/NameOfTestClass.java</include>
                                -->
                                <include>**/*Test.java</include>
                                <include>**/Test*.java</include>
                                <include>**/When*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>de.saumya.mojo</groupId>
                <artifactId>gem-maven-plugin</artifactId>
                <version>1.0.0-rc4</version>
                <configuration>
                    <jrubyVersion>${jruby.version}</jrubyVersion>
                    <gemHome>${project.build.directory}/${gem.home.directory}</gemHome>
                    <gemPath>${project.build.directory}/${gem.home.directory}</gemPath>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>initialize</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>bintray-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.1.2</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> 
                        <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <executions> 
                        <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> 
                        </executions> </plugin> -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <repository>
                    <id>bintray-lordofthejars-maven-asciidoctorj</id>
                    <name>lordofthejars-maven-asciidoctorj</name>
                    <url>https://api.bintray.com/maven/lordofthejars/maven/asciidoctorj</url>
                </repository>
            </distributionManagement>
        </profile>

        <profile>
            <id>distribution</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.4</version>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/default.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>assembly</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>rubygems-release</id>
            <url>http://rubygems-proxy.torquebox.org/releases</url>
        </repository>
        <repository>
            <id>rubygems-prerelease</id>
            <url>http://rubygems-proxy.torquebox.org/prereleases</url>
        </repository>
    </repositories>
</project>
