<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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">
  <parent>
    <artifactId>batchee-servlet</artifactId>
    <groupId>org.apache.batchee</groupId>
    <version>2.0.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>batchee-webapp</artifactId>
  <name>BatchEE :: GUI :: Servlet :: WebApp</name>
  <packaging>war</packaging>

  <dependencies>
    <dependency>
      <groupId>org.apache.batchee</groupId>
      <artifactId>batchee-servlet-embedded</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.3.2</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <archiveClasses>true</archiveClasses>
          <attachClasses>true</attachClasses>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>tomcat</id>
      <activation><activeByDefault>true</activeByDefault></activation>

      <build>
        <plugins>
          <plugin> <!-- use mvn tomcat7:run  -->
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
              <ignorePackaging>true</ignorePackaging>
              <path>/</path>
              <warSourceDirectory>${project.basedir}/src/main/resources/META-INF/resources</warSourceDirectory>
              <additionalClasspathDirs>
                <additionalClasspathDir>${project.build.directory}/${project.build.finalName}.${project.packaging}
                </additionalClasspathDir>
                <additionalClasspathDir>${project.build.directory}/${project.build.finalName}-tests.${project.packaging}
                </additionalClasspathDir>
              </additionalClasspathDirs>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-util</artifactId>
                <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-coyote</artifactId>
                <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-api</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-dbcp</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-servlet-api</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jsp-api</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jasper</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jasper-el</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-el-api</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-catalina</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-tribes</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-catalina-ha</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-annotations-api</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-juli</artifactId>
                <version>${tomcat.version}</version>
              </dependency>

              <dependency>
                <groupId>jakarta.inject</groupId>
                <artifactId>jakarta.inject-api</artifactId>
                <version>${dependency.version.jakarta.inject-api}</version>
              </dependency>
              <dependency>
                <groupId>jakarta.batch</groupId>
                <artifactId>jakarta.batch-api</artifactId>
                <version>${dependency.version.jakarta.batch-api}</version>
              </dependency>
              <dependency>
                <groupId>jakarta.json</groupId>
                <artifactId>jakarta.json-api</artifactId>
                <version>${dependency.version.jakarta.json-api}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.johnzon</groupId>
                <artifactId>johnzon-jaxrs</artifactId>
                <version>${johnzon.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                <version>${cxf.version}</version>
                <exclusions>
                  <exclusion>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                  </exclusion>
                  <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-javamail_1.4_spec</artifactId>
                  </exclusion>
                  <exclusion>
                    <groupId>org.apache.ws.xmlschema</groupId>
                    <artifactId>xmlschema-core</artifactId>
                  </exclusion>
                  <exclusion>
                    <groupId>org.codehaus.woodstox</groupId>
                    <artifactId>woodstox-core-asl</artifactId>
                  </exclusion>
                </exclusions>
              </dependency>
              <dependency>
                <groupId>org.apache.batchee</groupId>
                <artifactId>batchee-jbatch</artifactId>
                <version>${project.version}</version>
              </dependency>
            </dependencies>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>tomee</id>

      <build>
        <finalName>batchee</finalName>
        <plugins>
          <plugin>
            <groupId>org.apache.tomee.maven</groupId>
            <artifactId>tomee-maven-plugin</artifactId>
            <version>${tomee.version}</version>

            <dependencies>
              <dependency>
                <groupId>jakarta.batch</groupId>
                <artifactId>jakarta.batch-api</artifactId>
                <version>${dependency.version.jakarta.batch-api}</version>
              </dependency>

              <dependency>
                <groupId>org.apache.batchee</groupId>
                <artifactId>batchee-jbatch</artifactId>
                <version>${project.version}</version>
              </dependency>
            </dependencies>

          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>