<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.overlord.apiman</groupId>
    <artifactId>apiman-dt-ui</artifactId>
    <version>1.0.0.Alpha3</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <artifactId>apiman-dt-ui-war-fuse6</artifactId>
  <packaging>war</packaging>
  <name>apiman-dt-ui-war-fuse6</name>

  <dependencies>
    <!-- The base WAR being extended -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-dt-ui-war</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-dt-ui-war</artifactId>
      <classifier>classes</classifier>
      <type>jar</type>
      <scope>provided</scope>
    </dependency>

    <!-- Overlord Commons -->
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-gwt</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-i18n</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-uiheader</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
          </archive>
          <overlays>
            <overlay>
              <groupId>${project.groupId}</groupId>
              <artifactId>apiman-dt-ui-war</artifactId>
              <excludes>
                <exclude>WEB-INF/classes/META-INF/services/*</exclude>
                <exclude>WEB-INF/lib/*.jar</exclude>
              </excludes>
            </overlay>
          </overlays>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.overlord</groupId>
                  <artifactId>overlord-commons-uiheader</artifactId>
                  <version>${version.org.overlord.overlord-commons}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/overlord-commons-uiheader</outputDirectory>
                  <includes>**/META-INF/resources/**</includes>
                  <excludes>**/*.class</excludes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/overlord-commons-uiheader/META-INF/resources</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </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>
          <manifestLocation>${project.build.directory}/osgi</manifestLocation>
          <instructions>
            <Web-ContextPath>/apiman-dt-ui</Web-ContextPath>
            <Webapp-Context>/apiman-dt-ui</Webapp-Context>
            <Import-Package>
              javax.servlet.http,
              javax.servlet,
              org.slf4j,
              org.codehaus.jackson,
              org.codehaus.jackson.map,
              org.codehaus.jackson.map.annotate,
              org.apache.commons.io,
              !org.apache.commons.configuration,
              !org.overlord.commons.config,
              !org.jboss.errai.common.client.api.annotations,
              !org.jboss.errai.bus.server.annotations,
              org.overlord.commons.i18n,
              org.overlord.commons.services,
              org.overlord.commons.gwt.server.filters,
              org.overlord.commons.i18n.server.filters,
              org.overlord.apiman.common.auth,
              !org.overlord.apiman.dt.ui.server,
              !org.overlord.apiman.dt.ui.server.auth,
              !org.overlord.apiman.dt.ui.client.shared.beans,
              org.apache.karaf.jaas.boot.principal,
              org.eclipse.jetty.plus.jaas,
              *
            </Import-Package>
            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <!-- Disable this check - this is an overlay project with no direct dependencies -->
          <execution>
            <id>enforce-direct-dependencies</id>
            <phase>non-existant</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
