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

    JBoss, Home of Professional Open Source.
    Copyright 2014-2022 Red Hat, Inc., and individual contributors
    as indicated by the @author tags.

    Licensed 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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>parent</artifactId>
    <groupId>org.jboss.pnc</groupId>
    <version>3.4.4</version>
  </parent>

  <artifactId>ear-package</artifactId>
  <name>ear-package</name>
  <packaging>ear</packaging>

  <properties>
    <includeMessagingInAppXml>true</includeMessagingInAppXml>
  </properties>

  <profiles>
    <profile>
      <id>without-messaging</id>
      <properties>
        <excludeMessaging>messaging.jar</excludeMessaging>
        <includeMessagingInAppXml>false</includeMessagingInAppXml>
      </properties>
    </profile>
  </profiles>

  <dependencies>
    <!-- Depend on the modules so that we can package them -->
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>auth</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>moduleconfig</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>bpm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>datastore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>build-coordinator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>remote-build-coordinator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>model</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jboss.pnc</groupId>
        <artifactId>rest</artifactId>
        <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>demo-data</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>web</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>messaging-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>messaging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>causeway-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc.metrics</groupId>
      <artifactId>pncmetrics</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>dto</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>rest-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>constants</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>mapper</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>facade</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>notifications</artifactId>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-ear-plugin</artifactId>
          <configuration>
            <archive>
              <manifestEntries combine.children="append">
                <Dependencies>
                  org.apache.commons.beanutils,
                  org.apache.commons.codec,
                  org.apache.commons.collections,
                  org.apache.commons.io,
                  org.apache.commons.lang,
                  org.apache.commons.lang3,
                  org.apache.httpcomponents.core,
                  jdk.net,
                </Dependencies>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-io</artifactId>
            <version>2.7.1</version>
          </dependency>
        </dependencies>
        <configuration>
          <defaultLibBundleDir>lib</defaultLibBundleDir>
          <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
          <packagingExcludes>${excludeMessaging}</packagingExcludes>
          <modules>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>auth</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>common</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>moduleconfig</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>bpm</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>datastore</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>build-coordinator</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>remote-build-coordinator</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>model</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>spi</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>demo-data</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>messaging</artifactId>
              <includeInApplicationXml>${includeMessagingInAppXml}</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>messaging-spi</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>causeway-client</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc.metrics</groupId>
              <artifactId>pncmetrics</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>rest-api</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>dto</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>constants</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>mapper</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>facade</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <jarModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>notifications</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
              <bundleDir>/</bundleDir>
            </jarModule>
            <webModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>rest</artifactId>
              <bundleDir>/</bundleDir>
              <contextRoot>/pnc-rest</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.jboss.pnc</groupId>
              <artifactId>web</artifactId>
              <bundleDir>/</bundleDir>
              <contextRoot>/pnc-web-config</contextRoot>
            </webModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
