<?xml version="1.0"?>
<!--
 *
 * Copyright (c) 2011, REMPL.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1) Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 2) Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution.
 * 3) Neither the name of the REMPL.com nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @version $Id: pom.xml 721 2011-03-16 22:40:43Z yegor256@yahoo.com $
 *
 -->
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.rempl</groupId>
        <artifactId>rempl</artifactId>
        <version>1.0</version>
    </parent>
    <artifactId>rempl-api</artifactId>
    <packaging>jar</packaging>
    <name>API</name>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
        </dependency>
        <dependency>
            <groupId>com.rempl</groupId>
            <artifactId>rempl-tk</artifactId>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
        </dependency>
        <dependency>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
            <groupId>org.antlr</groupId>
            <artifactId>antlr-runtime</artifactId>
            <!--
            @todo #6 The scope has to be set to TEST, instead of COMPILE, but
                     I can't do this for the following reasons:
                     http://stackoverflow.com/questions/5278338
                     http://jira.codehaus.org/browse/MANTLRTHREE-17
            -->
            <scope>compile</scope>
        </dependency>
        <dependency>
            <!--
            Apache Xerces is a JAXP implementation of DOM/XPath and
            XML Schema validator. In order to replace a default implementation
            provided by JDK with Xerces we are using text files inside
            "src/main/resources/META-INF/services" directory. Every file
            identifies the class to be used as an implementation for
            a given factory. This approach gives us enough flexibility
            to replace implementation at any moment, if necessary.
            -->
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.9.1</version> <!-- 9 Mar 2011 -->
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <!--
            Apache Xerces dependency.
            -->
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.3.04</version> <!-- 9 Mar 2011 -->
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <!-- see details in rempl/pom.xml/dependencyManagement -->
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <!--
                Run all tests again but with logging turned OFF. It is
                necessary to increase code coverage. Somewhere in the
                code we depend on logging configuration.
                -->
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>test-without-logging</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <!--
                        This execution is bound to such a strange phase because
                        if we bind it to "test" it will be merged with the main
                        goal, and configuration won't be effective.
                        -->
                        <phase>process-test-classes</phase>
                        <configuration>
                            <systemPropertyVariables>
                                <log4j.configuration>
                                    file:${project.basedir}/src/test/resources/log4j-off.properties
                                </log4j.configuration>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!--
                With this plugin we inform Maven that ANTLR3 auto-generated
                JAVA classes shall be compiled during TEST phase.
                -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version> <!-- 12 Mar 2011 -->
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-test-sources/antlr3</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!--
                ANTLR3 plugin. More details in parent pom.
                -->
                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>antlr</id>
                        <goals>
                            <goal>antlr</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.basedir}/src/test/antlr3</sourceDirectory>
                            <outputDirectory>${project.build.directory}/generated-test-sources/antlr3</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!--
                @todo #6 This is temporary workaround, until we fix the problem
                         with antlr3 which adds itself to compilePath
                -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <configuration>
                    <excludeFilterFile>${project.basedir}/src/test/maven/findbugs/exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <plugin>
                <!--
                @todo #6 This is temporary until the problem is fixed with
                         ANTLR3 plugin. Exclude ANTLR3 autogenerated classes from
                         code coverage.
                -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <instrumentation>
                        <excludes>
                            <exclude>com/rempl/impl/model/*</exclude>
                        </excludes>
                    </instrumentation>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
