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

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-parent</artifactId>
    <version>5.17.4</version>
  </parent>

  <artifactId>activemq-web-demo</artifactId>
  <packaging>war</packaging>
  <name>ActiveMQ :: Web Demo</name>
  <description>Web Demo for REST API and Streamlets support</description>

  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <configuration>
          <connectors>
            <connector implementation="org.eclipse.jetty.server.ServerConnector">
              <port>${jetty.port}</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
          <scanIntervalSeconds>10</scanIntervalSeconds>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
          <packagingExcludes>
            WEB-INF/lib/jetty*.jar,
            WEB-INF/lib/servlet*.jar,
            WEB-INF/lib/activemq*.jar
          </packagingExcludes>
          <webResources>
            <resource>
              <directory>${basedir}/../activemq-web-console/src/main/webapp/styles/</directory>
              <targetPath>styles</targetPath>
            </resource>
            <resource>
              <directory>${basedir}/../activemq-web-console/src/main/webapp/images/</directory>
              <targetPath>images</targetPath>
            </resource>
            <resource>
              <directory>${basedir}/../activemq-web-console/src/main/webapp/js/</directory>
              <targetPath>js</targetPath>
            </resource>
          </webResources>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Webapp-Context>activemqdemo</Webapp-Context>
            <Web-ContextPath>/activemqdemo</Web-ContextPath>
            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>
              org.apache.activemq,
              org.apache.activemq.web,
              org.xml.sax,
              org.xml.sax.helpers,
              javax.xml.parsers,
              javax.xml.transform,
              javax.management.remote,
              javax.naming,
              org.w3c.dom,
              javax.servlet,
              javax.servlet.http,
              javax.servlet.resources,
              javax.servlet.jsp,
              javax.servlet.jsp.tagext,
              javax.servlet.jsp.el,
              javax.management,
              javax.management.openmbean,
              javax.net,
              org.osgi.framework,
              org.osgi.service.cm,
              org.apache.commons.logging;version="[1.1,2)";resolution:=optional,
              org.apache.xbean*;version="[3.13,5)",
              org.slf4j;version="[1.6,2)";resolution:=optional,
              org.slf4j.spi;version="[1.6,2)";resolution:=optional,
              org.apache.log4j;version="[2,3)";resolution:=optional,
              org.apache.log4j.spi;version="[2,3)";resolution:=optional
            </Import-Package>
            <Export-Package>
              !*
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <dependencies>
    <!-- j2ee jars -->
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jms_1.1_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jta_1.1_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jacc_1.1_spec</artifactId>
    </dependency>

    <!-- activemq -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>activemq-web</artifactId>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>activemq-unit-tests</artifactId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>activemq-broker</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>activeio-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-jaas</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- web container -->
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <scope>test</scope>
    </dependency>

    <!--  for custom XML parsing -->
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-spring</artifactId>
    </dependency>
    <dependency>
      <groupId>xpp3</groupId>
      <artifactId>xpp3</artifactId>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
    </dependency>

    <!-- used for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang-version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Derby SQL DB used for testing JDBC message store -->
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>${org-apache-derby-version}</version>
    </dependency>
  </dependencies>

  <properties>
    <jetty.port>8080</jetty.port>
  </properties>

  <profiles>
    <profile>
      <id>activemq.tests-sanity</id>
      <activation>
        <property>
          <name>activemq.tests</name>
          <value>smoke</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/AjaxTest.*</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
	<profile>
      <id>activemq.tests-autoTransport</id>
      <activation>
        <property>
          <name>activemq.tests</name>
          <value>autoTransport</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
