<?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-platform-livedata</artifactId>
    <version>13.10.7</version>
  </parent>
  <packaging>jar</packaging>
  <artifactId>xwiki-platform-livedata-rest</artifactId>
  <name>XWiki Platform - Live Data - REST Services</name>
  <properties>
    <!-- Name to display by the Extension Manager -->
    <xwiki.extension.name>Live Data REST Services</xwiki.extension.name>
    <checkstyle.suppressions.location>
      ${basedir}/src/checkstyle/checkstyle-suppressions.xml
    </checkstyle.suppressions.location>
    <xwiki.jacoco.instructionRatio>0.38</xwiki.jacoco.instructionRatio>
  </properties>
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>xwiki-platform-livedata-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- We reuse the LinkCollection and Map types from xwiki.rest.model.xsd  -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>xwiki-platform-rest-model</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- Live data REST resources extend XWikiResource -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>xwiki-platform-rest-server</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-tool-test-component</artifactId>
      <version>${commons.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <configuration>
          <generatePackage>org.xwiki.livedata.rest.model.jaxb</generatePackage>
          <!-- Make sure we don't regenerate / duplicate the xwiki-platform-rest-model classes. -->
          <useDependenciesAsEpisodes>true</useDependenciesAsEpisodes>
          <!-- Use a catalog to specify the path to the xwiki.rest.model.xsd -->
          <!-- See also https://github.com/highsource/maven-jaxb2-plugin/wiki/Modular-Schema-Compilation -->
          <catalog>src/main/resources/catalog.cat</catalog>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </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>
        <executions>
          <execution>
            <!-- Specify the "default" execution id so that the "blocker" one is always executed -->
            <id>default</id>
            <configuration>
              <excludes>
                org/xwiki/livedata/rest/model/jaxb/*.java
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
