<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
	  <groupId>io.hawt</groupId>
	  <artifactId>project</artifactId>
    <version>1.5.redhat-078</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>hawtio-redhat-amq-branding</artifactId>
  <packaging>war</packaging>
  <name>${project.artifactId}</name>
  <description>hawtio :: Red Hat AMQ Branding</description>

  <properties>
    <plugin-context>/redhat-branding</plugin-context>
    <fuse.osgi.import>
      javax.servlet,
      *;resolution:=optional
    </fuse.osgi.import>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-plugin-mbean</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-api-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-redhat-fuse-branding</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- maven-bundle-plugin config, needed to make this war
        deployable in karaf, defines the context that this bundle
        should handle requests on -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven-bundle-plugin-version}</version>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Webapp-Context>${plugin-context}</Webapp-Context>
            <Web-ContextPath>${plugin-context}</Web-ContextPath>

            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>

            <Export-Package>${fuse.osgi.export}</Export-Package>
            <Import-Package>${fuse.osgi.import}</Import-Package>
            <DynamicImport-Package>${fuse.osgi.dynamic}</DynamicImport-Package>
            <Private-Package>${fuse.osgi.private.pkg}</Private-Package>

            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>

            <Bundle-Name>${project.description}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Implementation-Title>HawtIO</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
          </instructions>
        </configuration>
      </plugin>


      <!-- We define the maven-war-plugin here and make sure it uses
        the manifest file generated by the maven-bundle-plugin.  We
        also ensure it picks up our filtered web.xml and not the one
        in src/main/resources -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>${war-plugin-version}</version>
        <configuration>
          <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
          <packagingExcludes>**/classes/OSGI-INF/**</packagingExcludes>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <archive>
            <manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
          <overlays>
            <overlay>
              <groupId>io.hawt</groupId>
              <artifactId>hawtio-redhat-fuse-branding</artifactId>
              <excludes>
                <exclude>META-INF</exclude>
                <exclude>WEB-INF/classes</exclude>
                <exclude>plugin/img/logo.svg</exclude>
              </excludes>
            </overlay>
            <overlay>
            </overlay>
          </overlays>
          <!--
          <webResources>
            <resource>
              <filtering>true</filtering>
              <directory>src/main/resources</directory>
              <includes>
                <include>**/*.*</include>
              </includes>
            </resource>
          </webResources>
          -->
        </configuration>
      </plugin>


      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}/overlays</directory>
              <includes>
                <include>**/*.*</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
