<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Meeds project (https://meeds.io/).
Copyright (C) 2020 Meeds Association
contact@meeds.io
This program 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 3 of the License, or (at your option) any later version.
This program 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 program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

-->
<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>io.meeds.distribution</groupId>
    <artifactId>plf-packaging</artifactId>
    <version>7.2.0-M07</version>
  </parent>
  <artifactId>plf-tomcat-resources</artifactId>
  <packaging>pom</packaging>
  <name>Meeds:: Meeds:: Meeds Public Distribution - Packaging - Tomcat Resources</name>
  <dependencies>
    <!-- Logging implementation : http://logback.qos.ch/ -->
    <!-- Is configured from conf/logback.xml -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat</artifactId>
      <scope>runtime</scope>
      <type>zip</type>
    </dependency>
    <!-- Required by conditional processing in logback -->
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>janino</artifactId>
      <scope>runtime</scope>
    </dependency>
    <!-- Shared resources -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>plf-packaging-resources</artifactId>
      <scope>runtime</scope>
      <type>zip</type>
    </dependency>
    <!-- Kernel Container Integration Servlet -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>plf-tomcat-integration-webapp</artifactId>
      <scope>runtime</scope>
      <type>war</type>
    </dependency>
    <!-- Tomcat listener to create portlet containers -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>plf-tomcat-pc-creator-listener</artifactId>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <groupId>jakarta.servlet</groupId>
          <artifactId>jakarta.servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Required by logback for colorized console on windows -->
    <dependency>
      <groupId>org.fusesource.jansi</groupId>
      <artifactId>jansi</artifactId>
    </dependency>
    <!-- Embedded database - for dev and demos only -->
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
    </dependency>
    <!-- SLF4J API -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
    </dependency>
    <!-- PLF-6409: Required by Liquibase to not generate error -->
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
          <execution>
            <id>project-resources-zip</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptorRefs>
                <descriptorRef>project-resources-zip</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>plf-assemblies</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>exo-release</id>
      <build>
        <plugins>
          <!-- Validate wellformedness of (almost) all XML files -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>xml-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>validate-xml-files</id>
                <goals>
                  <goal>validate</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <validationSets>
                <validationSet>
                  <dir>src/main/resources</dir>
                  <includes>
                    <include>**/*.xml</include>
                  </includes>
                  <excludes>
                    <!-- This is a template not valid by default -->
                    <exclude>**/*.template.xml</exclude>
                  </excludes>
                </validationSet>
              </validationSets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
