<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 *
-->

<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>org.xwiki.platform</groupId>
    <artifactId>xwiki-core-rendering-parent</artifactId>
    <version>2.1.1</version>
  </parent>
  <artifactId>xwiki-core-rendering-api</artifactId>
  <name>XWiki Platform - Core - Rendering - Api</name>
  <packaging>jar</packaging>
  <description>XWiki Platform - Core - Rendering - Api</description>
  <dependencies>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-core-xml</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-core-properties</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-core-observation-local</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-core-configuration-api</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <version>1.6.1</version>
    </dependency>
    
    <!-- We need the Xerces dependency at runtime since we have an optimization for the Xerces
         parser (to tell it to cache DTD grammars). If it's not there then there's no DTD
         caching. -->
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
      <version>2.9.1</version>
      <scope>runtime</scope>
    </dependency>
      
    <!-- Testing dependencies -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-core-shared-tests</artifactId>
      <version>${pom.version}</version>
      <scope>test</scope>
      <!-- Exclude some deps drawn transitively and that we don't use.
           We do this to prevent the Enforcer plugin configuration for
           this module from failing. -->
      <exclusions>
        <exclusion>
          <groupId>org.xwiki.platform</groupId>
          <artifactId>xwiki-core-bridge</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.xwiki.platform</groupId>
          <artifactId>xwiki-core-configuration-api</artifactId>
        </exclusion>
      </exclusions>      
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/scaffolding/**.class</include>
                <!-- Required since we're using test components in the integration test module  -->
                <include>**/Test*Macro.class</include>
                <include>**/Test*Macro$*.class</include>
                <include>**/components.txt</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Apply the Checkstyle configurations defined in the top level pom.xml file -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <includes>
            **/rendering/block/*.java,
            **/rendering/configuration/*.java,
            **/rendering/converter/*.java,
            **/rendering/internal/configuration/*.java,
            **/rendering/internal/parser/*.java,
            **/rendering/internal/renderer/BasicLinkRenderer.java,
            **/rendering/listener/*.java,
            **/rendering/listener/chaining/AbstractChainingListener.java,
            **/rendering/listener/chaining/ChainingListener.java,
            **/rendering/listener/chaining/StackableChainingListener.java,
            **/rendering/listener/chaining/ListenerChain.java,
            **/rendering/macro/**/*.java,
            **/rendering/parser/*.java,
            **/rendering/renderer/*.java,
            **/rendering/renderer/chaining/*.java,
            **/rendering/renderer/printer/DefaultWikiPrinter.java,
            **/rendering/renderer/printer/WikiPrinter.java,
            **/rendering/renderer/xhtml/*.java,
            **/rendering/transformation/*.java,
            **/rendering/util/*.java
          </includes>
          <excludes>
            **/rendering/internal/parser/XDOMGeneratorListener.java,
          </excludes>
        </configuration>
      </plugin>
      <!-- Ensure that some modules are not added as dependencies. We don't want them since we want this API
           module to be usable outside of XWiki in a standalone manner.  -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>org.xwiki.platform:xwiki-core-bridge</exclude>
                    <exclude>org.xwiki.platform:xwiki-core-configuration-default</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <!-- We run Clirr in a profile since Cobertura interferes with Clirr and thus we run
           Cobertura instrumentation in a special profile (when the Cobertura profile is
           executed, the Clirr one isn't). -->
      <id>clirr</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>clirr-maven-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/internal/**</exclude>
                <!-- The excludes below need to be removed when 2.1 is released -->
                <exclude>org/xwiki/rendering/macro/descriptor/ParameterDescriptor</exclude>
                <exclude>org/xwiki/rendering/listener/chaining/LookaheadChainingListener</exclude>
                <exclude>org/xwiki/rendering/listener/chaining/LookaheadChainingListener$Event</exclude>
                <exclude>org/xwiki/rendering/block/HeaderBlock</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
